Iteration through a dropdown.
Hi there!
I'm new to PHP and I'm having trouble getting past this obstacle:
We're using a MySQL database and there is a particular field within a table that I'd like to compare to a dropdown. for example..
The field within the table is "state". It can contain the two letter abbreviation for any of the 50 states. On the page is a dropdown listing all of the 50 states and the values of the options within the dropdown are the two digit abbreviation of the states. When the page loads and pulls data from the database and populates editable fields, such as other text boxes, etc. How can I iterate through the dropdown and have the one that matches the entry within the database be "selected"?
Your time is appreciated. Thanks!
-Ben
|