Skip to main content
Known Participant
September 1, 2010
Answered

Populate dropdown PHP MySQL

  • September 1, 2010
  • 1 reply
  • 23015 views

Hi,

I have 4 dropdowns in a table and would like the first two to work together dynamically. (i.e second dropdown should populate based on first dropdown selection) the last two dropdowns are static.

I have found some code on a website (http://www.plus2net.com/php_tutorial/php_drop_down_list.php if it could help someone else) and it works fine, until I try to take it apart to work as I want it to and not like the author coded it. On that code, everything is inside one "PHP code (i.e <?php EVERYTHING IS HERE ?>)" and I edited the code accordingly to fit my table. The query part I put into my header and the actual functions on the page where they should be. The data gets extracted from the DB but the function to re-populate as soon as the first dropdown was selected fails.

Does anyone have any advice or anything else that could help my case?

Regards

This topic has been closed for replies.
Correct answer BenPleysier

Have a look here http://labs.adobe.com/technologies/spry/samples/data_region/DataSetMasterDetailSample.html

The example uses XML data that can be dynamically created from your database as per http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html

1 reply

BenPleysier
Community Expert
BenPleysierCommunity ExpertCorrect answer
Community Expert
September 1, 2010

Have a look here http://labs.adobe.com/technologies/spry/samples/data_region/DataSetMasterDetailSample.html

The example uses XML data that can be dynamically created from your database as per http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
reandre68Author
Known Participant
September 1, 2010

Hi,

Thanks a lot for the quick reply.

I had a look at the pages and this is exactly what I need.