Home >Database >Mysql Tutorial >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: 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:
1. Open the PHP editor sublime , create a new file and write comments.
#2. Create a new function chaxun.
#3. Connect to the database and fill in the database username, password, host name and the database to be used.
#4. Fill in the sql statement of the query. select * from test1.
#5. Read the queried data. The function we use here is fetch_assoc.
6. Call this function.
#7. Open the local server and enter the URL to test access.
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!