this code isnt workin:

$newer = mysql_query("DELETE FROM messages WHERE id = '$rawr', user = '$rew', read = '$roll'");

this code works:

$newer = mysql_query("DELETE FROM messages WHERE id = '$rawr' AND user = '$rew'");

the variable is the same that is included in the first, so its not the variable. i think i dont know how to have three of them cause i know that for two i can use the AND instead of commas.
please help i googled it and couldnt figure it out

8 Years
Discussion Span
Last Post by SKANK!!!!!

it is not working becasue you are using , instead of and

$newer = mysql_query("DELETE FROM messages WHERE id = '$rawr' AND user = '$rew' AND read = '$roll'");

this should work


You can use as many ANDs and ORs as you like, with as many parenthesis as you like to create as many logical sub-groupings as you like:

a AND b AND (c OR (d AND e) OR (f AND g)) ...

but be aware that at some point you cross a line where you should probably re-examine your join criteria and ask yourself why you're having to specify so much in a WHERE clause.


oh ok ive only had to specify about 3-4 tops in a where clause...
thanks. ive never user parenthesis yet.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.