|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
HTML Multiple select
Hoe do I insert into a table for a single field a html multiple select drop down list.
I have this to create my drop down list. # create SQL statement $sql = "SELECT * FROM genre ORDER BY gid ASC"; # execute SQL query and get result $sql_result = mysql_query($sql,$connection) or die("Couldn't execute query."); # put data into drop-down list box while ($row = mysql_fetch_array($sql_result)) { $os = $row["genre"]; $option_block .= "<OPTION value="$os">$os</OPTION>"; } And this to insert into my table "address" if ($REQUEST_METHOD=="POST") { # double-up apostrophes $description = str_replace("'","''",$description); $sitename = str_replace("'","''",$sitename); # setup SQL statement $SQL = " INSERT INTO address "; $SQL = $SQL . " (address, city, state, zip, phone, email, fname, lname, country, contact, instr) VALUES "; $SQL = $SQL . " ('$address', '$city', '$state', '$zip', '$phone', '$email', '$fname', '$lname', '$country', '$contact', '$instr') "; #execute SQL statement $result = mysql_db_query($db,"$SQL",$connection); # check for error if (!$result) { echo("ERROR: " . mysql_error() . "n$SQLn"); } echo ("<P><B>New Member Added</B></P>n"); } But I need the field $instr to be for the multiple insert. I'm lost. Please help |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > HTML Multiple select |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|