I have a PHP form which I use to edit a record in the MySQL data base and it has a drop down list of values I would like to set the option that is held in the database to be the
You could use
while($row = mysql_fetch_assoc($result)){ $selected = ""; if($row['id'] == $curValue){ $selected = "selected=\"selected\""; } echo "{$row['name']} }
After you've updated your question, it seems MattP's answer suits your situation better.