Re: Using SELECT IN with arrays
| From: | Jason Wong | Date: | Thu, 03 Feb 2005 00:37:44 +0000 |
| Subject: | Re: Using SELECT IN with arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-207955@lists.php.net to get a copy of this message | ||
On Thursday 03 February 2005 07:58, W Luke wrote:
> $doms is a "master array" of a user's domains. $d is a
> comma-seperated and unexploded list of domains to filter the SELECT
> down with. (error checking is already in place)
1) make both $d and $doms into array
2) use array_intersect() to find the $d's that match $doms
3) convert the matches into a comma separated string with single quotes around
the individual values
4) SELECT blah WHERE domain IN(comma separated string with single quotes
around the individual values)
> So basically I need to find *all* domains in $d (dom1.com,dom2.net)
> which appear in $doms,
>
> then extract all the other info
> (mq.user,mq.sender etc).
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
New Year Resolution: Ignore top posted posts