Re: equivalent of mysql_select_db in PEAR::DB
| From: | Lukas Smith | Date: | Thu, 19 Jan 2006 13:07:04 +0000 |
| Subject: | Re: equivalent of mysql_select_db in PEAR::DB | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-22604@lists.php.net to get a copy of this message | ||
hugo wrote:
Hi, I would like to know how to use PEAR::DB to select multiple DB on the same server. example (simplified) in mysql : mysql_connect (host, login, pass); mysql_select_db (db1); mysql_query (query); // a query on db1 .. mysql_select_db (db2); mysql_query (query); // a query on db2 I don't see how to change database with PEAR::DB.You cant with PEAR::DB. You would have to call connect() and thereby dropping the existing connection .. Or you can move to MDB2 which lets you call setDatabase(), which will mean it will switch the conncection upon the next query() call. regards, Lukas