Re: Re: DB and mysql_select_db
| From: | Justin Patrin | Date: | Thu, 22 Jul 2004 17:27:14 +0000 |
| Subject: | Re: Re: DB and mysql_select_db | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-32260@lists.php.net to get a copy of this message | ||
On 22 Jul 2004 18:12:41 +0100, Matt <matt@kynx.org> wrote:
> > Yes ... so imagine if you want to use multiple databases in a script.
> > That's why.
>
> Isn't that what the optional second parameter to mysql_query() is for?
> Keeping track of the connection you intend to use?
>
> connect() does choose the DB and simpleQuery() already does pass the
> resource link to avoid confusion. You have to create a second instance
> to use a different dsn anyway. That'll get its own resource link, so
> always calling mysql_select_db does seem overboard.
>
> But I might be wrong.
>
Some (older) versions of PHP select the DB on all connections to the
same mysql server. It was a bug and this was a workaround.
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--