Hey guys I have a dropdown menu with 17 options that I want to use to edit a mysql entry. Before I edit it though I want to load the value of that particular mysql column as the pre-selected value in the drop down. Whats the best way to accomplish this.
I figured I could write 17 if than statements but thats seems a bit tidious especially if I have more then 17 options.
I'd preffer to have the code written out for the options and just add in the selected statement if possible.
Example because I'm sure I'm not explaining very clearly.
<select name="country" id="country">
<option value="1">CAN</option>
<option value="2">USA</option>
<option value="3">RUS</option>
<option value="4">CZE</option>
</select>
If the result for country = 1 I'd like to add the selected code to the option.
Thanks guys!
Brian