For a bigger project it is necessary to do queries over tables of two (or even more) databases, located at different servers.
Is this possible, and how can I do this.
Any help is appreciated.
Thank you,
Christoph
http://www.filsca.com
| SitePoint Sponsor |
For a bigger project it is necessary to do queries over tables of two (or even more) databases, located at different servers.
Is this possible, and how can I do this.
Any help is appreciated.
Thank you,
Christoph
http://www.filsca.com





I do not believe that is possible; PHP and MySQL can only have one database connection alive at a time, so while you can have multiple tables joined with one query, you'll have to reconnect to retrieve or modify data located over multiple databases.
It would be nice if they could figure out a way to effeciently do this though; perhaps in future release of MySQL?![]()
Colin Anderson
Ambition is a poor excuse for those without
sense enough to be lazy.
Thank you Colin, although the answer is not really what I hoped for
Could one find a workaround by using temp tables - making one temp table of the fields needed from the one server, then connecting to the other server, creating another temp table from the first table and joining this one with the tables necessary from the second server?
Or other the data lost once the the other database is connected?
Is it possible with other databases then? PostgreSQL?
Cheers,
Christoph
Originally posted by Aes
I do not believe that is possible; ...![]()
![]()
you CAN join tables from multiple DBs very easily, but NOT when they're located on different servers. and that's what you're talking about right?
- Matt
Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
"Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR
Bookmarks