Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to query multiple MySQL db's in one query?

Status
Not open for further replies.

Spijker

Programmer
Jan 9, 2001
10
0
0
NZ
I am trying to extract information from two seperate tables from 2 different MySQL databases on the same server. Is this possible, and if so what would be the best way to go about it.

 
Yes. Just make the database name a prefix to your fields:
Code:
SELECT db1.table1.field1, db2.table2.field2
FROM db1.table1, db2.table2

-Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top