[snip]
I need to do an OR search on three columns, and AND the rest, anyone
have a good way to do this?  So far my searching on the MySQL lists have
been fruitless more then anything, and I figured we've probably come
across this ourselves at some point.
[/snip]

More of a MySQL question, but easily enough answered;

Always group the OR with parenthese and the AND individually. Write the
query and test with MySQL before placing into PHP code;

SELECT * FROM `table`
WHERE (`foo` = 'bar' 
   OR `foo` = 'glorp'
   OR `sqirk` = 'glorp')
AND `today` = CURDATE()
AND `userID` = 'Marvin'

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to