Re: PEAR DB: cannot use more than one database connection
| From: | John Lim | Date: | Tue, 16 Oct 2001 16:21:27 +0000 |
| Subject: | Re: PEAR DB: cannot use more than one database connection | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-393@lists.php.net to get a copy of this message | ||
PHP recycles database connections if the userid is the same.
Refer to the http://php.net/mysql_connect docs for more
info,
but it applies to all databases.
Solution: Create two userid's, one for each database connection.
Regards, John
Try an alternative database wrapper library:
http://php.weblogs.com/adodb
Ferenc Engard <engard@all.hu> wrote in message
news:3BCC50B3.F707C2C6@all.hu...
> Hello,
>
> If I am trying to use more than one connection, then it seems that PEAR
> overwrites the first connection's data with the second, at least at the
> query time.
>
> I have an object "A" returned by DB::connect(). I can execute queries
> with it as long as I don't create another DB object "B" with
> DB::connect. At that point the "A" object's queries return with error,
> and from the error message it reveals that it tries to execute the query
> in the "B" connection's database!
>
> Anyway, if I print out the db_mysql object, it shows the right database
> name, yet the error message's native code shows that another database is
> tried. :(
>
> What to do?
>
> Thx:
> Circum