Re: Array Select from database
| From: | Mark Rees | Date: | Wed, 28 Sep 2005 12:40:40 +0000 |
| Subject: | Re: Array Select from database | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-223348@lists.php.net to get a copy of this message | ||
Array ( [count] => 1 [0] => Array ( [clientaccountmanager] => Array (
[count] => 2 [0] => 210 [1] => 149 )
I've got the following Query="select * from client WHERE
clientaccountmanager='$value of array1' OR '$2nd value of array 1'"
So that the query loops through the whole array...
-----------------------------------------
No indenting for some reason, sorry
You should construct your query like this:
SELECT x FROM y where Z IN (value1,value2,value3)
For looping on arrays, have a look at foreach:
http://uk2.php.net/manual/en/control-structures.foreach.php
Hope this helps
Mark