Getting multiple values from List Box and save in DB

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
eshban
Forum Contributor
Posts: 184
Joined: Mon Sep 05, 2005 1:38 am

Getting multiple values from List Box and save in DB

Post 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
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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
}
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Locked