wsantos Posted July 26, 2007 Share Posted July 26, 2007 Is it possible to make a join from two connections? $con1 = mysql_connect("ip1","user","pwd"); if(!$con1) { die('Could not connect: ' . mysql_error()); } $db1 = mysql_select_db("table1",$con1); $con2 = mysql_connect("ip2","user","pwd"); if(!$con1) { die('Could not connect: ' . mysql_error()); } $db2 = mysql_select_db("table2",$con2); Quote Link to comment Share on other sites More sharing options...
Wildbug Posted July 26, 2007 Share Posted July 26, 2007 No, but you can join two databases within the same connection/host. Quote Link to comment Share on other sites More sharing options...
wsantos Posted July 30, 2007 Author Share Posted July 30, 2007 any suggestions for this? i need to get data from both remote db's.Thanks Quote Link to comment Share on other sites More sharing options...
Illusion Posted July 30, 2007 Share Posted July 30, 2007 We need to close first connection in order to connect to the second one, If at all u don't need both databases at a time , u write two functions(including mysql_close(); ) two deal with the two connections depending upon the need, u can call one. 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.