I think I'll have to forgive something very simple (and if I'm doing it).
I have a html doctor with a javascript in it, and in that html doctor, I would like to create a dropdown list whose value is automatically populated with the result of a mysql query.
I'm feeling that I need it to run a PHP script to get information from the database, but then how can that information be found in the dropdown is a mystery for me.
Please someone can tell me in the right direction - perhaps an example where someone has already done this.
I can not just write the dropdown in PHP because it means that I have everything else from the html page.
Many thanks,
Rob.
This is a very comprehensive question, so I'll give you a broad answer. Simple Guidelines
You have some options:
Put PPP in HTML xy.php / html Use Ajax to load data edit: or take the view that Haza suggests Whatever you choose, I will are the keywords to ask to search for further questions or more questions I
& lt; Choose Name = "Foss" & gt; & Lt ;? Php // php code to get data from mysql // foreach / when to do it again through the elements & quot; Option value = "'. $ Key." & Gt; ' $ Value '& Lt; / Option & gt; '; // End of Foreach / while? & Gt; & Lt; / Select & gt;
Comments
Post a Comment