[php]
<?
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.");
// Debug
echo 'We have '.mysql_num_rows($sql_event_type_result).' in the database<br />';
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>";
}
?>
[/php]
Cleaned up the formatting, removed the horrible escaping characters (you don't need these those if you differentiate between ' and " .. and added a debug call to make sure you are actually getting a result set back