How PHP works with MySQL

Source: Internet
Author: User
Tags php and mysql

PHP and MySQL related extensions are: MySQL, mysqli and PDO three kinds

MySQL extension is deprecated from php5.5.0 and is abolished starting from php7.0.0

MySQL used before---several basic functions: mysql_connect (); Mysql_close (); mysql_create_db (); Mysql_db_query (); mysql_drop_db ();

Querying the database from the Web:

A user's browser makes an HTTP request, requesting a specific Web page, which is to be processed within PHP (for example, results.php) by touching the published form. Web server

After the Web server receives a request to the results.php page, it retrieves the file and passes it to the PHP engine for processing

The PHP engine starts parsing the script. The script mainly includes the command to connect to the database and execute the query. PHP initiates a connection to the MySQL server and sends the appropriate query to the server.

The MySQL server receives a request for a database query, starts processing the query, and returns the query results to the PHP engine.

After the PHP engine has finished running the script, return the HTML to the Web server.

The Web server then returns HTML to the client browser, and the user can see the resulting page after the response.

How PHP works with MySQL

Related Article

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.