) PHPandAJAXMySQLDatabaseExample

Source: Internet
Author: User
PHPandAJAXMySQLDatabaseExample reference address: http://www.w3schools.com/PHP/php_ajax_database.asp

AJAX can be used for interactive communication with a database.

AJAX Database Example

In the AJAX example below we will demonstrate how a web page can fetch information from a MySQL database using AJAX technology.

Select a Name in the Box Below

Select a User: Peter Griffin in Lois Griffin in Joseph Swanson Glenn Quagmire

User info will be listed here.

This example consists of four elements:

A MySQL database a simple HTML form a JavaScript a PHP page

The Database

The database we will be using in this example looks like this:

Id FirstName LastName Age Hometown Job
1 Peter Griffin in 41 Quahog Brewery
2 Lois Griffin in 40 Newport Piano Teacher
3 Joseph Swanson 39 Quahog Police Officer
4 Glenn Quagmire 41 Quahog Pilot

The HTML Form

The example above contains a simple HTML form and a link to a JavaScript:

                        

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.