Re: Question on SELECT
| From: | Leif K-Brooks | Date: | Sat, 14 Jun 2003 01:00:13 +0000 |
| Subject: | Re: Question on SELECT | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-151446@lists.php.net to get a copy of this message | ||
$query = 'select * from table where fieldname in(\''. implode('\',\'',$myArray) . '\')';
Roy W wrote:
I have a bunch of variables stuffed in myArray() I want to run a MySQL SELECT statement ($query=" ......") where it will access only those records in the database "WHERE" table.fieldname is found in myArray Is there a simple one liner? Or do I have to "loop" it through (kinda nasty as you can imagine) Help anyone? Thanks!! :-))-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.