Re: MySQL Modules and multiple database
| From: | Szii | Date: | Mon, 13 Aug 2001 21:55:23 +0000 |
| Subject: | Re: MySQL Modules and multiple database | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-11313@lists.php.net to get a copy of this message | ||
Done both.
In fact, I create an object which has 2 database objects in it.
If I dump the objects, I can WATCH as they "merge" and point
at the same database.
I go back to using mysql_db_query() and everything's fine.
It would appear that the mysql_select_db() is not persisting.
If you call it on two different links, it's seems to modify both
links. Almost like it's global....
*shrug*
-Szii
----- Original Message -----
From: "Paul Burney" <burney@gseis.ucla.edu>
To: "Szii" <szii@sziisoft.com>; "php mailing list"
<php-db@lists.php.net>
Sent: Monday, August 13, 2001 2:28 PM
Subject: Re: [PHP-DB] MySQL Modules and multiple database
> on 8/13/01 1:56 PM, Szii (szii@sziisoft.com) wrote:
>
> > Opening multiple databases on the same database machine
> > seems unsupported. While you CAN do it, it has a tendency
> > to "reuse" the last connection even in lieu of a specific database.
> > Right now we're using mysql_db_query() to get around it, but
> > with that becoming deprecated, we need to find anothe solution.
>
> Before each query (from a different database), you can call the function;
>
> mysql_select_db($database_name, $connection_id)
>
> You can also specify the connection id for your queries:
>
> mysql_query($query, $connection_id)
>
> Just make sure that you select the db before each query otherwise a query
> will use the last selected database.
>
> Sincerely,
>
> Paul Burney
>
> +-------------------------+---------------------------------+
> | Paul Burney | P: 310.825.8365 |
> | Webmaster && Programmer | E: <webmaster@gseis.ucla.edu> |
> | UCLA -> GSE&IS -> ETU | W:
> <http://www.gseis.ucla.edu/> |
> +-------------------------+---------------------------------+