RE: Check Boxes

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

 



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