Can someone show me where I go wrong. I am trying to populate a drop down list with field "type_desc" from the [U]eventType[/U] table. Upon selection, the value that will be passed will be "type_code". All I am getting is a blank drop list. Can someone help.
Tablename: eventType
Fields:
type_code type=int auto-increase
type_desc type=text
<?
include 'db.php';
$sql_event_type = "select type_code,type_desc from eventType";
$sql_event_type_result = mysql_query($sql_event_type,$connection)
or die("Couldn't execute query.");
if ($sql_event_type_result) {
echo "<SELECT NAME='type_code'>";
while ($type_row = mysql_fetch_array($sql_event_type_result)){
echo "<OPTION VALUE=\"".$type_row["type_code"]."\">".
$type_row["type_desc"]." </OPTION> ";
}
echo "</SELECT>";
}
?>
Thanks
tip