I have a field on a webpage that is used to edit an existing record. The page draws in data from the MySQL backend.
Each text field will display the data from the database, except for the List box. How do I get the List box to be preselected using PHP?
Here is my List box code:
<select name="CategoryID" id="CategoryID">
<option value="1">Business</option>
<option value="2">Financial</option>
<option value="3">Health</option>
<option value="4">Home</option>
<option value="5">Legal</option>
<option value="6">Shopping</option>
<option value="7">Travel</option>
</select>
On the text fields, I have been using:
<? echo $row['MetaTitle']; ?>
So what do I use to set the List Box to show the existing records correct data?