I have a database with names stored. I have my query of the database working, but lets say I have 5 names that I want to display in a drop down menu. How do I make the default text in the drop down menu display those 5 names?
Basically what I am trying to accomplish is this:
Query my database and store all the names of clients to a variable. Say there are 5 names in the database, I need those 5 names to be stored in a variable. And then for my drop down menu, normally I put the text in like this: < option>Single Floor< /option>
But how do I get those 5 names to appear in the drop down list?
Below is a simple pseudo-script that selects information from a database and outputs a select drop down box. You will need to replace
*_fetch_arraywith whatever DB Extension you are using, and$row['Value']and$row['DisplayValue']with the appropriate field names from your DB Schema.The select will submit
$row['Value']to the form handler, while displaying$row['DisplayValue']to the user in the drop down list.