Form Select Tag into Multiple DB Rows
Posted: Fri Apr 18, 2003 2:32 pm
Hello,
My form looks something like:
Obviously, I would have more variables as options etc...
The data I want to select in this form is such that I will select one item from the first select tag and multiple items from the 2nd select tag.
What I then want is to have a new record inserted into the DB for each item selected from the variable2 select tag.
Does the information get passed to update_db.php as an array? So could I loop thru the array? If this is the case, I assume for each pass it would have the same value for variable1 and the different values selected for variable2?
Any help would be appreciated.
My form looks something like:
Code: Select all
<form action="update_db.php" method="post">
<select name="variable1">
<option value="a">description
</select>
<select name="variable2" multiple>
<option value="1">description
</select>The data I want to select in this form is such that I will select one item from the first select tag and multiple items from the 2nd select tag.
What I then want is to have a new record inserted into the DB for each item selected from the variable2 select tag.
Does the information get passed to update_db.php as an array? So could I loop thru the array? If this is the case, I assume for each pass it would have the same value for variable1 and the different values selected for variable2?
Any help would be appreciated.