Jump to content

Connecting to 2 databases


vchris

Recommended Posts

Well, you just have to declare the connection for each database. Here's an example:$con1 = mysql_connect("server1","user1","password1");$con2 = mysql_connect("server2","user2","password2");When using functions like mysql_query() don't forget to put $con1 or $con2 as the connection parameter. For example:$data1 = mysql_query("SELECT * FROM table",$con1);$data2 = mysql_query("SELECT * FROM anothertable",$con2);

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...