I have a simple database structure with a table for venues and events.
I am trying to add a select drop down in my form to add a new event which lists the venues, and inserts the VenueID into a field in the Events table.
I have this, which I think is pretty close, but its not pulling anything through:
<select name="VenueID">
<?php
$sql = "SELECT VenueID, Venue FROM Venues ORDER BY Venue ASC";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
echo '<option value="' . $row['VenueID'] . '">' . $row['Venue'] . '</option>';
}
?>
</select>
Thanks for any pointers.