RE: Final question of the week :-)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----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 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux