| | |
how do i do three WHERE clauses with php (mysql)
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
this code isnt workin:
this code works:
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
PHP Syntax (Toggle Plain Text)
$newer = mysql_query("DELETE FROM messages WHERE id = '$rawr', user = '$rew', read = '$roll'");
PHP Syntax (Toggle Plain Text)
$newer = mysql_query("DELETE FROM messages WHERE id = '$rawr' AND user = '$rew'");
please help i googled it and couldnt figure it out
it is not working becasue you are using , instead of and
this should work
PHP Syntax (Toggle Plain Text)
$newer = mysql_query("DELETE FROM messages WHERE id = '$rawr' AND user = '$rew' AND read = '$roll'");
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: 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.
PHP Syntax (Toggle Plain Text)
a AND b AND (c OR (d AND e) OR (f AND g)) ...
![]() |
Similar Threads
- Looking for PHP / MySQL Developer (Web Development Job Offers)
- Looking for a PHP/MYSQL Programmer (Web Development Job Offers)
- Need Highly Experienced PHP/MySQL Programmer $15-$25/hour (Web Development Job Offers)
- PHP/MySQL Programmer Position (Web Development Job Offers)
Other Threads in the PHP Forum
- Previous Thread: PHP parsing error with html tag... does this mean I have misbalanced braces?
- Next Thread: PostBack method on Page Refresh
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email encode error fcc file files folder form forms function functions google howtowriteathesis href htaccess html image images include insert integration ip java javascript joomla ldap limit link login loop mail menu mlm mod_rewrite multiple multipletables mysql oop open parse paypal pdf php problem provider query radio random recursion regex remote script search server sessions sms soap source space sql strip_tags structure syntax system table template tutorial update upload url validation validator variable video web xml youtube






