In this article, we introduce the integration of PHP and MySQL. Since it is integrated with MySQL, we must first install MySQL. Below we will introduce the installation method of MySQL.
The first step is to download MySQL. To download PHP, you can go to PHP Chinese Network PHP Download Station to download the latest version.
The second step is to install the MySQL database
##The third step is the same as installing Apache. Create a MySQL folder under the PHPedu folder and install it in this folder. , change the installation directory, click Next The fourth step is to start the installation
Just click Next from this step, until here In the first step, we set up an administrator, set the password here, click Next Click on the arrow to continue the installation Even if the installation is completed here Next we will integrate PHP and MySQL. First, open the php.ini configuration file under the PHP folder in the editor. Then locate extension_dir in the editor, around line 720, as shown below: Then, uncomment the corresponding line of code, as shown below: At this point, the MySQL configuration we need to modify has been modified. The next step is to restart our Apache server. After the database is opened, it needs to be connected. How to connect? We need to write a piece of code to connect to the database, as shown below: #Run it on the browser, you will see that the connection is successful Okay, now the integration of our database and our PHP is complete. For detailed tutorials, please refer to the PHP Chinese website video tutorial:
Integration of MySQL and PHP: enabling PHP to process databases
[Related recommendations]1.Independent installation one: Apache service installation and testing steps graphic tutorial
2.php Chinese website recommended download :php programmer toolbox
3.Picture and text tutorial on the installation steps of PHPstudy under Windows environment
4.Under Windows system Installation tutorial steps of wampserver tool (picture)
The above is the detailed content of Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases. For more information, please follow other related articles on the PHP Chinese website!