| | |
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
![]() |
•
•
Join Date: Apr 2009
Posts: 281
Reputation:
Solved Threads: 2
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 |
ajax apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail mediawiki menu mlm msqli_multi_query multiple mysql number oop paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search server sessions sms soap source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web websphere white wordpress xml youtube






