Re: multiple query in 1 select ?

From: Date: Thu, 01 Mar 2001 07:44:54 +0000
Subject: Re: multiple query in 1 select ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-42131@lists.php.net to get a copy of this message
In article <3A9DEDAB.79E8C41@innovativeinternet.com>, jack@innovativeinternet.com (Jack Sasportas) wrote: > lets say we have a database with the State Names and cities, and I > wanted to select all the cities in FL I would execute something like > this > mysql_query("SELECT * FROM cities WHERE state='FL'"); > and lets say there are 50 records returned.... > > I want to be able to get all the cities in FL & GA instead of just FL > and display the results together as if it was 1 restult. Then the resul > would be 100 records ( 50 FL & 50 GA ). > > Thanks! > > I did look on php.net and in a php book I have, but could not find > anything... The reason you couldn't find you answer in a PHP reference is that it's really a SQL question you're asking. Any basic SQL reference should help. In answer to your question: a where clause can have multiple conditions such as "WHERE state='FL' or state='GA'", which means if a record matches either of the two possible conditions, then that record will be displayed. -- CC

« previous php.general (#42131) next »