NYCPHP Meetup

NYPHP.org

[nycphp-talk] MySQL Syntax questions

Kristina Anderson ka at kacomputerconsulting.com
Wed May 28 18:42:44 EDT 2008


I have two questions regarding syntax for MySQL queries.

1.  I have complex queries where there are lots of conditional 
statements, i.e. SELECT * FROM table WHERE this=this AND that=that OR 
thing=thing OR blah=blah OR foo=foo AND bar=bar OR etc=etc OR 
thing2=thing2...


They are not erroring out but they aren't narrowing the resultset 
sufficiently...do I need parentheses or is there something else I need?

2.  How can I select the last row inserted from a table WHERE 
field1=somethingineed and field2 is NULL?

Thanks in advance...full of questions today I am!



--- Kristina 



More information about the talk mailing list