Through the study of the previous chapter, we have finished learning MySQL. PHP sending data to MySQL and PHP operating the MySQL database are the key points.
Let me give you some examples:
... There are too many application scenarios. From web pages, mobile terminals, and QQ WeChat public accounts, PHP is used to connect to the database for operations.
In order to make it easier for everyone to learn, we have divided the knowledge of connecting to the database into steps. You will find that you can easily learn how to connect to the database with PHP.
The database connection knowledge we have prepared is applicable to almost all database connection methods.
You can also use this set of solutions and steps for database connection functions such as PDO and PgSQl.
Before we officially start learning, we need to enable the mysqli extension. Using phpinof(), you can see the following display, indicating that the opening is successful:
If there is no mysqli extension module. I have studied with you in the "10.PHP Image Processing" chapter. If you do not see the mysqli extension under the windows server, open the php.ini file and open php_mysqli.dll.
Note:
Starting from PHP7, the mysql extension is no longer supported by default, that is, the mysql_* series of functions are no longer supported. Please use mysqli to connect to the database.
mysqli supports both php5 and php7.