hi,
i have made a select/option dropdown menu as part of a ‘add user’ form. One of my sections is a select as follows:
<select name=”addaccount” id=”addaccount”>
<option value =”c”>Customer</option>
<option value =”a”>Administrator</option>
</select>
and when i submit my form, it adds it to the database as required & selected… so the value ‘a’ or ‘c’ goes into the database.
My problem arises when you go back to amend the user details. I can retreive all the values from the database fine (and i can echo them to confirm they are retrieved properly), but i don’t know and cannot work out how to make a the same drop down box as above, but with the value from the database as the ‘selected’ option.
eg. say the value in the database was ‘a’, how can i make the same dropdown box appear, but with Administrator selected and not Customer?
Obviously i would end up expanding this for a longer options list, so radio buttons aren’t a good idea for me.
thanks in advance.
Rich.