What is the script used for MySQL Ajax tree?

Asked By 20 points N/A Posted on -
qa-featured

How do you create or what is the script that can be used to have MySQL Ajax tree? Can anybody give some sample codes on making this?

Thanks.

SHARE
Answered By 5 points N/A #155951

What is the script used for MySQL Ajax tree?

qa-featured

Hi

I am giving you a script code which is in a Php language with Ajax and MySql Database.
 
The following example will demonstrate how a web page can fetch information from a database with AJAX.
 
1. The HTML Page: In html page there is a drop down list named 'User' and an event 'onChange'. In script tag there is a function showUser which retrieves the users details.
 
2. PHP File: The page on the server called by the JavaScript above is a PHP file called "getuser.php".
The source code in "getuser.php" runs a query against a MySQL database, and returns the result in an HTML table:
 
When the query is sent from the JavaScript to the PHP file, the following happens:
 
1. PHP opens a connection to a MySQL server
2. The correct person is found
3. An HTML table is created, filled with data, and sent back to the "txtHint" placeholder.

Related Questions