RE: [PHP-DB] Final question of the week :-)
| From: | Ford, Mike [LSS] | Date: | Wed, 11 Dec 2002 11:51:11 +0000 |
| Subject: | RE: [PHP-DB] Final question of the week :-) | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-24058@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Chris Payne [mailto:cjp@planetoxygene.com]
> Sent: 10 December 2002 23:10
>
> I use the following code to collect date from multiple
> tickboxes on my form:
>
> if (count($selection) >= 1) {
> for ($i=0;$i<count($selection);$i++) {
>
> echo $selection[$i];
>
> }};
>
> $selection is the ID number and passes fine, but what I need
> it to do is
> query my DB via the above query displaying the results from
> the multiple
> ID's, how can I do this from this array? I know from a
> single ID / string
> but not this way.
$sql = 'SELECT ... WHERE id IN (' . implode(',' $selection) . ')';
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211