get mysql value to dispaly in drop menu
Posted: Sat Jul 07, 2007 6:03 pm
I am building a CMS for a real estate site, with COMMERCIAL and RESIDENTIAL page listings. The CMS has ADD/SELECT/EDIT/DELETE pages for both sections. The ADD page is a basic form page, with a coulple of DROP MENUs; when submitted the data is recored in a MYSQL database.
The EDIT page is a mirror of the ADD page; the data is retrieved from the database and placed into the form fields for editing by the user - except for the DROP DOWN MENUs. The drop menus default to the first value in the form but I can't seem to get the DROP MENUs on the EDIT page to show the value that is in the database.
Been working with PHP MYSQL for less than a year, so my apolgy if this is "no brainer".
Thanks in advance,
Greg
The EDIT page is a mirror of the ADD page; the data is retrieved from the database and placed into the form fields for editing by the user - except for the DROP DOWN MENUs. The drop menus default to the first value in the form but I can't seem to get the DROP MENUs on the EDIT page to show the value that is in the database.
Code: Select all
<select name="restype" class="">
<option selected value="">
<option value="SINGLE FAMILY HOME">SINGLE FAMILY HOME
<option value="DUPLEX FAMILY HOME">DUPLEX FAMILY HOME
<option value="MULTI FAMILY PROPERTY">MULTI FAMILY PROPERTY
<option value="CONDOMINIUM">CONDOMINIUM
<option value="LAND (RESIDENTIAL)">LAND (RESIDENTIAL)
</select>Thanks in advance,
Greg