Home  >  Article  >  Database  >  How to query data in two databases at the same time in mysql

How to query data in two databases at the same time in mysql

coldplay.xixi
coldplay.xixiOriginal
2020-10-20 14:47:576528browse

How to query data in two databases at the same time in mysql: first open the editor sublime and create a new function chaxun; then connect to the database, fill in the user name, password, host name of the database and the database to be used; then fill in Query the sql statement; finally open the local server and enter the URL for access testing.

How to query data in two databases at the same time in mysql

How to query data in two databases at the same time in mysql:

1. Open the PHP editor sublime , create a new file and write comments.

How to query data in two databases at the same time in mysql

#2. Create a new function chaxun.

How to query data in two databases at the same time in mysql

#3. Connect to the database and fill in the database username, password, host name and the database to be used.

How to query data in two databases at the same time in mysql

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

How to query data in two databases at the same time in mysql

#5. Read the queried data. The function we use here is fetch_assoc.

How to query data in two databases at the same time in mysql

6. Call this function.

How to query data in two databases at the same time in mysql

#7. Open the local server and enter the URL to test access.

How to query data in two databases at the same time in mysql

More related free learning recommendations: mysql tutorial(Video )

The above is the detailed content of How to query data in two databases at the same time in 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