Posts Tagged ‘AJAX’
PHP ajax cascading dropdown using MySql
Written by Codes Tips on May 16, 2009 – 5:31 pm -To do cascading drop down in php using mysql we can use AJAX. The name AJAX is from asynchronous JavaScript and XML and it’s a new technique for web development to build rich interactive web application. The power of this technique comes from the fact that it can send to server requests from the client side, in order to not reload the page. The object that is using AJAX to send and retrieve data between server and the client is named XmlHttpRequest.
To build a cascading drop down in php to retrieve data from a mysql server we will first populate a drop down with the results from a first table from a mysql database. The first table is linked with a second table by a field. When we change the drop down we should assign to OnChanging event an Javascript function that will populate the second drop down . The function will create a new XmlHttpRequest object and make a call to other php script, grab data and populate the second drop down. The script that it’s called will fetch the results for that field that was changed.
Watch a demo here:populate drop down using ajax
Download php cascading drop down using mysql
Tags: AJAX, PHP, PHP/MYSQL
Posted in AJAX, Codes, PHP/MYSQL, Scripts | 15 Comments »


















