Re: PEAR::DB - two simultaneous connections - bugs?
| From: | Maciek Szczytowski | Date: | Fri, 27 Jun 2003 08:42:50 +0000 |
| Subject: | Re: PEAR::DB - two simultaneous connections - bugs? | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-17779@lists.php.net to get a copy of this message | ||
It works! Thanks.
Regards,
Maciek
Uzytkownik "Tomas V.V.Cox" <cox@idecnet.com> napisal w wiadomosci
news:48227097.20030627103005@idecnet.com...
>
> Please be sure to use the lastest version of the class.
>
> On Friday, June 27, 2003 9:34, Maciek Szczytowski wrote:
>
> > Hi.
> > I'm trying to connect to 2 databases at the same time.
> > I have something like that:
>
> > $DB1 = DB::connect($dsn1,false);
> > $DB2 = DB::connect($dsn2,false);
>
> $result1 = $DB1->>query($sql1);
> $result2 = $DB2->>query($sql2);
>
> > Now, $result1 is a PEAR Error:
>
> > db_error Object
> > (
> > [error_message_prefix] =>
> > [mode] => 1
> > [level] => 1024
> > [code] => -18
> > [message] => DB Error: no such table
> > [userinfo] => select sth_id from sth_table [nativecode=Table
> > 'database2.sth_table' doesn't exist]
> > [callback] =>
> > )
>
> > So, $DB1 is connected to database2. Why?
>
> > I use MySQL. Connect function is in file DB/mysql.php in line 118
>
> > $conn = @$connect_function($dbhost, $user, $pw);
>
> > I changed it into:
>
> > $conn = @$connect_function($dbhost, $user, $pw, true);
>
> > 'true' means 'make new resource' - but it hasn't helped.
>
> > Some suggestions?
>
> > Regards,
> > Maciek
>
>
>
>
>
>
> --
> Tomas V.V.Cox mailto:cox@idecnet.com
>
>