Home > Backend Development > PHP Tutorial > Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

巴扎黑
Release: 2023-03-07 19:08:02
Original
3745 people have browsed it

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.

Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

The second step is to install the MySQL database

Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

##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

Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

The fourth step is to start the installation

Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

1Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

Just click Next from this step,

1Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

until here In the first step, we set up an administrator, set the password here, click Next

1Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

Click on the arrow to continue the installation

Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

Even if the installation is completed here

Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

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:

Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

Then, uncomment the corresponding line of code, as shown below:

Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

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:

Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

#Run it on the browser, you will see that the connection is successful

1Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases1Graphical tutorial on integrating MySQL and PHP: enabling PHP to process databases

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 downloadphp 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)

5.Tutorial on the installation and configuration steps of MAMP Pro development tools under Mac system (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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template