[PHP-DB] Multiple values in SELECT query

2008-03-09 Thread Ron Piggott
What is the correct syntax for where the results may be 1 or 2?  What
have I done wrong?

SELECT * FROM table WHERE name LIKE ABC AND listing_type = 1 or 2

???

Ron


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



Re: [PHP-DB] Multiple values in SELECT query

2008-03-09 Thread Matt Anderton
I like the IN keyword:

SELECT * FROM table WHERE name LIKE ABC AND listing_type IN ('1','2');

works kinda like PHP's in_array

-- matt



On Sun, Mar 9, 2008 at 1:34 PM, Ron Piggott [EMAIL PROTECTED]
wrote:

 What is the correct syntax for where the results may be 1 or 2?  What
 have I done wrong?

 SELECT * FROM table WHERE name LIKE ABC AND listing_type = 1 or 2

 ???

 Ron


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