Home >Backend Development >PHP Problem >How to query data with php mysql?

How to query data with php mysql?

烟雨青岚
烟雨青岚Original
2020-06-15 10:22:513357browse

How to query data with php mysql?

php How to query data with mysql?

Method steps:

1. Open the php editor sublime, create a new file, and write the comment content.

How to query data with php mysql?

2. Create a new function chaxun

How to query data with php mysql?

3. Connect to the database and fill in the database Username, password, hostname, and database to use.

How to query data with php mysql?

4. Fill in the query sql statement: select * from test1

How to query data with php mysql?

##5. To read the queried data, the function we use here is fetch_assoc.

How to query data with php mysql?

6. Call this function.


How to query data with php mysql?

7. Open the local server and enter the URL for access testing. The results are as shown in the figure.


How to query data with php mysql?

Recommended tutorial: "

php tutorial"

The above is the detailed content of How to query data with php mysql?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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