I have a form which allows users to update information already set in a row. In this case a drop down populated with row items, with the previously specified option in the default position.
Code: Select all
<?php
include("connect.php");
$query="SELECT locationName FROM location";
$result = mysql_query ($query);
echo "<select name='eventLocation'><option value=''>'$row['eventLocation']'</option>";
while($nt=mysql_fetch_array($result)){
echo "<option value='$nt[locationName]'>'$nt[locationName]'</option>";
}
echo "</select>";
?>
Can anyone give me any advice on what I'm doing wrong here. Should I echo the row or not?
Many thanks.