Re: search based on array
| From: | Richard Lynch | Date: | Tue, 31 Jul 2001 05:14:06 +0000 |
| Subject: | Re: search based on array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-60333@lists.php.net to get a copy of this message | ||
> For example suppose I had an array of array(1,2,3). And I want to
> search like so:
>
> SELECT * FROM table WHERE id=arrayvalues
$values = array (1, 2, 3);
$sql_values = implode(', ', $values);
$query = "select * from table where id in ($sql_values)";
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm