cascading dropdown using ajax Php and mysql.

dependent dropdown with ajax and php is very common to use script so I create one script for developers cascading dropdown ajax post is about how to create dependent dropdown with jQuery Mysql Php.I have seen there are many tutorial ,but this tutorial is populate dropdown using ajax with xml. In the example we will take 3 dependent dropdown list

In this tutorial we fetch data from database and covert it to xml format and populate it into dropdown with the help of jQuery/Javacript.Thge reason to convert data to xml is that it can be easily populated to next dropdown with help of jQuery/Javascript in fraction of seconds.

In some internet turorial they create the dropdown and send it as a response but it is not good so,In this totorial we send only data to the browser as response.

At the end of this article you can view its live example and can download toolkit to play.

Now lets start how to fill dropdown list using javascript,jquery,Ajax, Php and mysql.

at the end i create two ajax dropdown examples,One is ajax dropdown with javascript and second ajax dropdown with jquery.

The cascading dropdown will be done with “Parent child” relation between them. In this example we are using three drop down so there is catagory , subcategory and sub-subcatagory.

In example we populate dropdown with ajax items will be.

Printer Manufacturer.

Printer Type.

Printer Model.

Lets digg into the logic.

Database : (Mysql)

Table structure for these will be look like this.The Image shows the relation between these three tables.