Both connects are "active".

you specify which link when you select the database:
mysql_select_db("database_name", $db1);  mysql_select_db("database_name",
$db2);

-----Original Message-----
From: James Taylor [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 01, 2002 12:48 PM
To: PHP List
Subject: [PHP] Connecting to multiple DB's


I host a few sites, and on usually each site will have it's own MySQL 
database in the background.  I've decided that I want to link one site 
to another, and need to connect to more than one database at a time.
I've found that when I try to connect to 2 or more, even if I assign the 
other database to another variable
(ie .

$db1 = @mysql_connect($dbhost, $dbuser, $dbpass);
$db2 = @mysql_connect($dbhost2, $dbuser, $dbpass);

)

, the last connect called is the only one that is active.

Any work arounds to this?  I've been having to do it where I connect to 
one when needed, then connect to the other, etc.  I'm thinking there has 
to be a better way to do this.

Also, what is the function to kill a connection to a db?  Thanks!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to