Using SELECT IN with arrays
| From: | W Luke | Date: | Wed, 02 Feb 2005 23:58:50 +0000 |
| Subject: | Using SELECT IN with arrays | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-207954@lists.php.net to get a copy of this message | ||
Hi.
I'm trying to execute a query which does a SELECT IN on an
array...here's how it stands:
$doms = implode( "','", $domarray );
$d=$_GET['d']
$qmailsql = "SELECT mq.id,
mq.user,
mq.domain,
mq.sender,
mq.arrive_time,
mq.subject,
mq.body_preview,
mq.relay
FROM mail_quarantine AS mq
WHERE //??
ORDER BY mq.arrive_time DESC LIMIT 50";
$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)
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).
I've spent all day trying to work it out, but I think my *logic* is
wrong...any ideas much appreciated
Thanks
--
Will The Corridor of Uncertainty http://www.cricket.mailliw.com/
- Sanity is a madness put to good use -