Selected Items to SQL

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

Post Reply
anshuverma1989
Forum Newbie
Posts: 13
Joined: Sat Jan 10, 2009 2:21 pm

Selected Items to SQL

Post by anshuverma1989 »

Hello Guys,

I have this dropdown box and a list box.

Now what i want is when a person selects multiple items in the list box.. to go to different different lines in SQL Database.

Like suppose have dropdown box with Red, Blue, Green.

Like my dropdown has Red, Green and Blue as option and my list Menu has Very Dark, Dark, Light and Very Light.

Now what i want if user chooses all four or three options, the data that will be entered into SQL will be:
id | color | Shade
1 | Red | Very Dark
2 | Red | Dark
3 | Red | Light

mainly the options which will be selected will entered as new line in SQL table.

How can i do that?

Thanks and Regards,
Anshu Verma
User avatar
SpecialK
Forum Commoner
Posts: 96
Joined: Mon Sep 18, 2006 3:49 pm

Re: Selected Items to SQL

Post by SpecialK »

Once the form is posted to the PHP server, you should be doing your own error checking logic. Once the logic shows the data is valid, create the query to insert the data into the database.
Post Reply