Re: PEAR with multiple databases

From: Date: Sun, 03 Mar 2002 15:54:10 +0000
Subject: Re: PEAR with multiple databases
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-928@lists.php.net to get a copy of this message
Valerio Santinelli wrote: > > I am trying to use more than one DB connection in the same script, but I'm experienceing > every kind of problems. > By default I'm connected to my application's main database, but at a certain point I > need to fetch some data from a different database. > What I am doing is instantiating a new DB connection through DB::connect() passing as parameter > the new DSN. > At this point I can do all my operations on the new db, but my old connection gets transferred > to the new one and I can no longer access the first db. PHP normally uses the same connection if the same access data is provided (user, pass and host) and that is a problem when you need access to two or more databases in the same backend. This problem should be solved for MySQL, I'm not sure on others. What database are you using? Tomas V.V.Cox

« previous php.pear.general (#928) next »