Jump to content

Linking multiple database


nitation

Recommended Posts

No.

 

Use separate connections.

 

<?php
$connection1 = mysql_connect("host","user","pass") or die (mysql_error());
$database1 = mysql_select_db("database", $connection1);

$connection2 = mysql_connect("host","user","pass") or die (mysql_error());
$database2 = mysql_select_db("database", $connection2);

$sql = "SELECT * FROM `table`";
$res = mysql_query($sql, $database1) or die(mysql_error());

$sql2 = "SELECT * FROM `table2`";
$res2 = mysql_query($sql2, $database2) or die(mysql_error());
?>

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.