Dynamic Drop Down Box From Mysql November 06, 2022 Post a Comment I got 3 input fields and each field are getting their data from its own tables called Tour type, country and destination respectively as shown Tour Type Solution 1: Please go through this link dependent dropdown using jquery ajax How he maintained the relations among the entities let me explain you if you want countries based on tour then you need to relate the country table with tour table as you have shown the country table in image it contains only two columns countries_id and countries_name you have to add one more column that is tour_type_id when you select any tour you will get the tour_type_id then your query should be SELECT * FROM `countries` where `tour_type_id` = 1 //this is the id you will get from the tour_type select box Copy and this will populate the related countries same case for the destination related this table with country_id Hope it makes senseBaca JugaPhp Not Inserting Content In Mysql Database: Text, Images, AnythingAdd Div With Dynamic Vergejs Viewport Values To HtmlPhp Not Inserting Content In Mysql Database: Text, Images, Anything Solution 2: as i am an asp.net developer i can suggest you put your 2nd and 3rd drop down in an update panel(ajax update panels) then in your 2nd drop down query make it like $sql=mysql_query("Select countries_id,countries_name from countries where tour_type_id="+element_11.SelectedItem.Value+""); it will select those values whose tour_type_id is same as you selected in first drop down, same logic can be use in 3rd drop down as well Solution 3: There are two ways to sole this.. you can use use php with a page refresh and 2nd way use jQuery ajax to populate fields accordingly. Share You may like these postsDownload File Program Using Php On Hp-ux BoxSubmitting Form Replaces Constant Get Information That Is Needed For The PageImage Resize Using Php Image MagicianHow To Do Two Post Requests For Visitors With Js Disabled On One Submit Button? Post a Comment for "Dynamic Drop Down Box From Mysql"
Post a Comment for "Dynamic Drop Down Box From Mysql"