Populate Combobox From MySQL Table query
Posted: Tue Jan 21, 2020 4:41 pm
Hi,
I'm working on a page that requires the user to select an option from a combobox (type : listbox). Rather than explicitly type the option values into the combobox, I would like to pull in the values from a MySQL table - via suitable query and HTML/PHP code? I have looked all over the forum for advice/guides as to how to populate the text & values this way, however can't seem to find anything other than an old forum entry from 2015 which gave a pre SQLi solution. I have tried this (converted to SQLi) and it doesn't populate the values. Is this solution still relevant ? (by Feedrich ยป Fri Mar 20, 2015 4:46 pm)
Am I missing something really simple here? Or is it a complicated coding solution ?
NB: As a test, I can create a Select box and populate from a table/query via HTML and PHP, however, the solution is nowhere as neat as the possible webbuilder combobox .....
Advice appreciate.
Dougie.
I'm working on a page that requires the user to select an option from a combobox (type : listbox). Rather than explicitly type the option values into the combobox, I would like to pull in the values from a MySQL table - via suitable query and HTML/PHP code? I have looked all over the forum for advice/guides as to how to populate the text & values this way, however can't seem to find anything other than an old forum entry from 2015 which gave a pre SQLi solution. I have tried this (converted to SQLi) and it doesn't populate the values. Is this solution still relevant ? (by Feedrich ยป Fri Mar 20, 2015 4:46 pm)
Am I missing something really simple here? Or is it a complicated coding solution ?
NB: As a test, I can create a Select box and populate from a table/query via HTML and PHP, however, the solution is nowhere as neat as the possible webbuilder combobox .....
Advice appreciate.
Dougie.