Dropdownmenu SELECTED value as per value return fromDB
- by Faizan Qadri
All i am trying to do is to set the selected value of drop down menu according to the particular value returned from the database
like if person saved his gender as 'Male' and he wants to update his profile then the selected option shown on the Gender's dropdown llist should be
shown as Male
cause if this doesn't happen 'Poor guy becomes a female due to this small problem in my code'
KINDLY HELP!!!!!!!
MY Current Code:
<select name="Gender" id="Gender">
<option selected="selected"><?php echo $row_Recordset1['Gender']; ?></option>
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
The above code work fine but causes repitition of values in dropdown like
Male
Male
Female