I have a page that works OK at the moment but am looking to change an input box to a dropdown list. The page picks up a record and then sticks the info into boxes for the user to edit then save. The issue I’m having is getting the dropdown box to default to the value retrieved from the database. The important bit of code in my php file is:
echo ' <tr><td><label for="status">Status: </label></td> <td><select name="status" id="status" class="narrow"> <option value="Not started">Not started</option> <option value="In progress">In progress</option> <option value="Update done">Update done</option> <option value="Book only">Book only</option> </select>
I have the variable $status which comes from the database but cannot get the selected option to show correctly. How do I get it to work? Thanks.