简体   繁体   English

使用MySQL和PHP的多个下拉选择

[英]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 如果用户在第一个下拉菜单中选择TOUCH,则第二个下拉菜单应显示12MP和17MP

if user selects Keypad in 1st drop down then then second drop down should display 16MP and 19MP 如果用户在第一个下拉菜单中选择了键盘,则第二个下拉菜单应显示16MP和19MP

... ...

the php code which i'm using is only displaying one drop down. 我正在使用的php代码仅显示一个下拉列表。 kindle please help me in solving this... 点燃请帮助我解决这个问题...

MySQL - Table MySQL-表

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!! 谢谢!!

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. 对于所有这些,您最好使用ajax。 Jquery has a very nice and easy to use ajax function that you can be used to do all above! jQuery具有一个非常好用且易于使用的ajax函数,您可以用来执行以上所有操作! have a look here: http://api.jquery.com/jQuery.ajax/ 在这里看看: http : //api.jquery.com/jQuery.ajax/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM