AJAX can be used for interactive communication with a database.
The Below example will demonstrate how a web page can fetch information from a database with
The database table we use in the example above looks like this:
When a user selects a user in the dropdown list above, a function called "showUser()"
is executed. The function is triggered by the "onchange" event:
The showUser() function does the following:
The source code in "getuser.html" runs a query against a MySQL database, and returns
the result in an HTML table:
Your Query was successfully sent!