dynamic dropdown
Posted: Tue Jun 28, 2005 10:07 am
i have a form that is sorta like a registration page. i need a dropdown from which the user selects a building. here's the html version, straightforward:
however, we have all buildings stored in a database and it's easiest when a new building is added to just add it to the database and it will be automatically reflected in the dropdown. how do i accomplish this using php?
just a note: i am using php and mssql, not mysql...i may be able to translate mysql code to mssql, maybe
. here's my building table structure:
Code: Select all
<select name="e;requiredbuilding"e;>
<option value="e;1"e;>Building 1</option>
<option value="e;2"e;>Building 2</option>
<option value="e;3"e;>Building 3</option>
</select>just a note: i am using php and mssql, not mysql...i may be able to translate mysql code to mssql, maybe
Code: Select all
building_num | building_name
----------------------------
1 building 1
2 building 2
3 building 3