I know how to create a dropdown box using php. The problem is, I would like for the selected value to be a value that has been querried from the database.
I am working on an update/delete form. One of the options the user has is to change their company name on this update/delete form. When the update/delete form is first displayed, I want the user's current company name to be displayed as the selected value in the dropdown box. If the user chooses to change their company name, all they have to do is select another name from the dropdown box.
Below is an example of what I've tried already, but doesn't work. $company_name has already been selected from the database and defined.
<?
print ('<select name=company_name>');
print ('<option value=1> $company_name </option>');
print ('<option value=2>Company1</option>');
print ('<option value=3>Company2</option>');
?>
Any ideas?
Thanks,
Jamie