PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I would like to populate a drop down menu using data from a table. I have searched around here and have tried the code to fit my needs to no avail unfortunately. Any help is always appreciated. Here is what i have so far
As you can see here, i would like to take the data value name from a database, and populate it in a dropdown menu. The send the result to a variable name ud_tof. I get no results the way it currently is.
No nothing really, I am just looking for ideas so that I can get started.
I know how to use the sql to select from and where and things and I have a dbconnection script which I use as a include.
My idea is to populate a dropdown based on company name and then pass the company name to another page through a hidden form field so that I can select other things from the database relating to the company name.
I find this much more readable as you do not keep switching PHP on and off. Also be aware of the <strong> tag (Better is to use span with CSS). I believe the <Strong> it is only for Explorer (Also check that tags in select options work as I don't believe they do).
For an even more complicated example have a look at Javascript and Dynamic Select Boxes Which populates one select box when a user selects an option from the first.
No worries, it is used in the middle of an HTML form. It will ask for a new product and list those products in a drop down and echo the selected option once chosen. It works like a charm. Thanks for the link!