Page 1 of 1

Getting multiple values from List Box and save in DB

Posted: Wed Sep 07, 2005 2:43 am
by eshban
Hi,

I have a one LIST BOX , in which a user has option to select multiple values. I want that if user select 3 values from LIST BOX, then my program saves all these values in a DB

plz help me in in the code

bye


feyd | double posting threads = no-no. Original Thread: viewtopic.php?t=37837

Posted: Wed Sep 07, 2005 2:46 am
by s.dot
I assume this is what you mean by LIST

Code: Select all

<input type="checkbox" name="name[]" value="1">
<input type="checkbox" name="name[]" value="2">
<input type="checkbox" name="name[]" value="3">
Then to process the data

Code: Select all

foreach($name AS $value)
{
  // insert into db
}