I have a drop down list which contains about twenty options. Each options contains more than one word. When a user selects an option the selected item is supposed to be displayed in the database. This works ok but the problem is that only the first word of the option selected is displayed in the database. For example if the option 'Foil Drift' is selected from the list only 'Foil' is displayed in the database. Here is the code I am using to insert the data into the database
<?PHP
echo "<select name = errorgroup>";
while(list($Error)=mysql_fetch_row($result)){
echo "<option value =$Error>$Error</option>\n";
}
echo "</select>";
$errorgroup=$_POST['errorgroup'];
$sql = "INSERT INTO redo( ErrorGroup) values( '$errorgroup')";
$result=mysql_query($sql,$db);
?>
Does anyone know how I can get this code to display the full option selected in the database?
<?PHP
echo "<select name = errorgroup>";
while(list($Error)=mysql_fetch_row($result)){
echo "<option value =$Error>$Error</option>\n";
}
echo "</select>";
$errorgroup=$_POST['errorgroup'];
$sql = "INSERT INTO redo( ErrorGroup) values( '$errorgroup')";
$result=mysql_query($sql,$db);
?>
Does anyone know how I can get this code to display the full option selected in the database?