I know how to make pull down menus populated with references from the mysql database.. however what I am having trouble with is having the saved data as the selected option in the pull down menu..
This is the code I have:
<p><?php<br>
<br>
// <---print the referee list in a pull down menu<br>
<br>
$result = mysql_query("SELECT * FROM referees ORDER BY refname
ASC",$db);<br>
<br>
while ($myrow = mysql_fetch_array($result)) {<br>
<br>
if (eregi($mp_referee, $chosenref)) {<br>
<br>
printf("<option selected value=\"%s\">%s,
%s</option>\n", $myrow["refname"],
$myrow["refname"], $myrow["refcity"]);<br>
<br>
} else {<br>
<br>
printf("<option value=\"%s\">%s, %s</option>\n",
$myrow["refname"], $myrow["refname"],
$myrow["refcity"]);<br>
<br>
}<br>
<br>
}<br>
<br>
?></p>
PLEASE tell me what I am doing wrong 🙂