Page 1 of 1

Populate Combobox From MySQL Table query

Posted: Tue Jan 21, 2020 4:41 pm
by Saints13
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.

Re: Populate Combobox From MySQL Table query

Posted: Tue Jan 21, 2020 4:48 pm
by Pablo
I'm sorry, there is no standard solution for this. This will require PHP coding.

Re: Populate Combobox From MySQL Table query

Posted: Tue Jan 21, 2020 4:57 pm
by Saints13
Thanks for quick response. I just tried again - this time with data in the table :oops: , and the 2015 solution updated for SQLi does work :D

D.

Re: Populate Combobox From MySQL Table query

Posted: Thu Jun 25, 2020 6:05 pm
by texelbee
Hello, Saints13! Would you be willing to share how you accomplished that?