Re: DB_mysql and multiple conections
| From: | Manuel Lemos | Date: | Wed, 05 Sep 2001 20:56:08 +0000 |
| Subject: | Re: DB_mysql and multiple conections | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-1812@lists.php.net to get a copy of this message | ||
Hello,
"Tomas V.V.Cox" wrote:
>
> Hi,
>
> Max Holman <max@blueroo.net>, sent me a patch to solve the problem with
> Pear and Mysql when using multiple conections in the same script. His
> description of the problem:
>
> "Using the MySQL PEAR DB classes, it is not possible to use 2 different
> databases within the same script, unless the Hostname and/or password to
> connect to each database are completely different.
>
> I have implement a fix, which uses mysql_db_query() instead, and
> DB_mysql
> now holds the database name within itsself.
That was the solution that Metabase adopted a long time ago, but since
PHP 4.0.6 a big ugly message is spit by PHP when you call that function
telling you that it is deprecated. The definitive solution in the
current Metabase version is to use mysql_select_database before each and
every query that accesses a specific database.
Regards,
Manuel Lemos