davidz Posted October 30, 2007 Share Posted October 30, 2007 I'm using PHP5+Mysql 4.0+Apache 2.0. I need to join tables from two different Mysql servers. I've looked everywhere and can't find a for sure yes or no if this is possible. So my question is: Is it possible to join tables using php from two different servers? If yes, how? Thanks! David Quote Link to comment Share on other sites More sharing options...
fenway Posted October 30, 2007 Share Posted October 30, 2007 In theory, it's possible across 2 databases on the same machine if the credentials are the same, but otherwise, you have to "convince" the DB that the table exists "locally". Why not use a FEDERATED table? Quote Link to comment Share on other sites More sharing options...
davidz Posted October 30, 2007 Author Share Posted October 30, 2007 The two databases are on completely different servers, so doing a dbname.tblname.field in the SELECT will not work. Now correct me if I'm wrong, the FEDERATED tables are basically just aliases to a table on another server? Thanks, David Quote Link to comment Share on other sites More sharing options...
fenway Posted October 30, 2007 Share Posted October 30, 2007 Now correct me if I'm wrong, the FEDERATED tables are basically just aliases to a table on another server? Yes, that's correct... but you really should be using 4.1 or higher. Quote Link to comment Share on other sites More sharing options...
davidz Posted October 30, 2007 Author Share Posted October 30, 2007 Now correct me if I'm wrong, the FEDERATED tables are basically just aliases to a table on another server? Yes, that's correct... but you really should be using 4.1 or higher. Yeah, it's actually on our todo list to upgrade both servers to 5. Thanks for the info! David Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.