| From: | Shafer, Philip | Date: | Tue, 09 Dec 2003 23:30:00 +0000 |
| Subject: | |||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-9435@lists.php.net to get a copy of this message | ||
Can somebody give me a run down on how to use the DB package with multiple
databases? Do I have to connect and disconnect every time I want to use a
different databases or can I just create multiple database connections which
can remain open until the program exits?
I'd like to be able to do the following:
$datasources['headlines']['DSN']="mysql://some dsn";
$datasources['press']['DSN']=" mysql://some dsn";
$datasources['events']['DSN']="mysql://some dsn"
$datasources['headlines']['DBH']=
DB::connect($datasources['headlines']['DSN'], true);
$datasources['press']['DBH']=
DB::connect($datasources['press']['DSN'],
true); $datasources['events']['DBH']=
DB::connect($datasources['events']['DSN'], true);
I'd like to be able to use any DBH I need when ever I wanted? Is this
possible? Right now, when ever I try to execute a query it runs the query
on the database which was last connected to.
-phil
------------------
Philip Shafer
Web Programmer
Information Resources
Rowan University
856-256-4418
shafer@rowan.edu