Home > Database > Mysql Tutorial > body text

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

coldplay.xixi
Release: 2020-10-20 14:47:57
Original
6480 people have browsed it

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!

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!