smith
smith

Reputation: 1

Multiple Drop Down Selections with MySQL and PHP

i want to display multiple drop downs.

if users selects TOUCH in 1st drop-down then second drop down should display 12MP and 17MP

if user selects Keypad in 1st drop down then then second drop down should display 16MP and 19MP

...

the php code which i'm using is only displaying one drop down. kindle please help me in solving this...

MySQL - Table

id   Name         Feature       Camera
1  Samsung       Touch          12MP
2  Nokia         Touch          17MP
3  LG            Multi-Touch    16MP
4  Apple         Keypad         16MP
5  Sony          Keypad         19MP
6  Onida         Keypad+Touch   17MP
7  HTC           Keypad+Touch   15MP
8  Black Berry   Multi-Touch    15MP

Thank you!!

Upvotes: 0

Views: 361

Answers (1)

deviloper
deviloper

Reputation: 7240

Well this topic is available in many sites and forums and the codes are even available to download.. But in general, you need to need to send the value of the first dropdown to a controller(frameworks) or any PHP file to process it and query the details form the database. and propulate/create the next dropdown with the queried data! and for all of these you better use ajax. Jquery has a very nice and easy to use ajax function that you can be used to do all above! have a look here: http://api.jquery.com/jQuery.ajax/

Upvotes: 1

Related Questions