The problem is that I want to populate a select box then the user selects value and submit this to db. The problem however is that the select box\'s value is not passed. The values do appear but the selected valus is not passed. Where am i making the mistake or where can I get the correct code to do this ?
Thanks
This file submits to file2(addtodb.php)
<?
include \'db.php\';
$results2= mysql_query("SELECT * from product Group by make asc");
$idmake = "makeid";
$iddescription = "description";
$idnamemake = "make";
echo mysql_error();
?>
<form method=POST action=addtodb.php>
<?
echo" <select name=\'make\'>"; //start the select box
if (mysql_Numrows($results2)>0) //if there are records in the fields
{
$numrows=mysql_NumRows($results2); //count them
$x=0;
while ($x<$numrows){ //loop through the records
$theId=mysql_result($results2,$x,$idmake); //place each record in the variable everytime we loop
$theName=mysql_result($results2,$x,$idnamemake);
echo "<option value=\'$idnamemake\'>$theName</option>n"; //and place it in the select
$x++;
}
}
echo "</select>"; //close the select
?>
<p align=center><font face=Verdana size=1><input type=submit value=Submit name=B1><input type=reset value=Reset name=B2></font></p>
</form>