List:General Discussion« Previous MessageNext Message »
From:Daniel Brown Date:June 18 2010 8:40pm
Subject:Re: [PHP] newbie sequel question: how do we search for multiple
things on 1 field like:
View as plain text  
On Fri, Jun 18, 2010 at 16:30, Dave <dealtek@stripped> wrote:
> SELECT * FROM contacts WHERE state = 'CA' and  ???? name = 'bob' or
> name = 'sam' or name = 'sara' ????

    We begin by asking on the right list (mysql@stripped, CC'd
by courtesy).

    You're on the right track though.  Try a WHERE...IN statement:

    SELECT * FROM contacts WHERE state='CA' AND name IN ('bob','sam','sara');

-- 
</Daniel P. Brown>
daniel.brown@stripped || danbrown@stripped
http://www.parasane.net/ || http://www.pilotpig.net/
We now offer SAME-DAY SETUP on a new line of servers!
Thread
Re: [PHP] newbie sequel question: how do we search for multiple things on 1 field like:Daniel Brown18 Jun