Re: Using SELECT IN with arrays

From: Date: Thu, 03 Feb 2005 01:20:38 +0000
Subject: Re: Using SELECT IN with arrays
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-207959@lists.php.net to get a copy of this message
On Thu, 3 Feb 2005 08:37:44 +0800, Jason Wong <php-general@gremlins.biz> 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) Wicked - thanks Jason -- Will The Corridor of Uncertainty http://www.cricket.mailliw.com/ - Sanity is a madness put to good use -

« previous php.general (#207959) next »