PHP-Mysql table join from different host

ANTRAX

New Member
There is a table employee in the database abc_db at abc@localhost(server) and there is another table department in the database xyz_db at xyz@localhost(server). How can I join the tables using php mysql connection. I have written the following code but it does not generate any resource id.\[code\]$conn = mysql_connect("localhost","abc","abcdb");$conn1 = mysql_connect("localhost","xyz","xyzdb");$db_select=mysql_select_db("abc_db",$conn);$db_select1=mysql_select_db("xyz_db",$conn1);$sql="SELECT * FROM employee e LEFT JOIN department d ON e.department_id=d.id ";$res=mysql_query($sql);\[/code\]
 
Back
Top