On Sep 30, 2005, at 11:51 AM, Larry E. Ullman wrote:
I had this problem a while ago, when you try to create the second
connection
to the database with the same login credentials, i.e username and
password.
If mysql / php detect there is a connection already established
with those
details
: Micah Stevens [mailto:[EMAIL PROTECTED]
Sent: Jueves, 29 de Septiembre de 2005 01:10 p.m.
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Connecting to two MySQL databases
I don't see a reason to duplicate the class code, just make it keep track
of
the $link variable, and each instance
I had this problem a while ago, when you try to create the second
connection
to the database with the same login credentials, i.e username and
password.
If mysql / php detect there is a connection already established
with those
details it will return that specfic resouce and not create an
I don't see a reason to duplicate the class code, just make it keep track of
the $link variable, and each instance of the class can be a seperate
connection.. Then you can do what you want:
$db1 = new dbconn;
$db2 = new dbconn;
$db1-dbconn($host, $user, $pw);
$db2-dbconn($host2, $user2, $pw2);
I am working on an application that requires me to connect to two
MySQL databases both hosted on the same server.
I have an existing set of class files I created to handle the db
connection to the main database. To connect to the second database,
I duplicated my db class files and renamed
I agree with this solution!!
-Original Message-
From: Micah Stevens [mailto:[EMAIL PROTECTED]
Sent: Jueves, 29 de Septiembre de 2005 01:10 p.m.
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Connecting to two MySQL databases
I don't see a reason to duplicate the class code, just make