RE: [PHP-DB] Check Boxes
| From: | Ford, Mike [LSS] | Date: | Wed, 18 Aug 2004 10:35:59 +0000 |
| Subject: | RE: [PHP-DB] Check Boxes | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-35775@lists.php.net to get a copy of this message | ||
On 18 August 2004 11:24, randy wrote:
> $chkboxes = $_POST['ch'];
> $sql = 'SELECT ';
> foreach($chkboxes as $k => $v)
> {
> $sql .= $v;
> if($k < (sizeof($chkboxes) - 1))
> {
> $sql .= ', ';
> }
> }
> $sql .= ' FROM form';
$sql = 'SELECT ' . implode(', ', $chkboxes) . 'FROM form';
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211