Re: accessing two databases within one script
| From: | Andrew Kreps | Date: | Tue, 05 Oct 2004 20:23:35 +0000 |
| Subject: | Re: accessing two databases within one script | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-36627@lists.php.net to get a copy of this message | ||
On Mon, 04 Oct 2004 22:31:15 -0400, Gary Rachel <gcrachel@hotmail.com> wrote:
> I've tried not using the mysql_close statement. But that option doesn't
> select the new database, it seems to stay connected to the previous one,
> despite my specifying a new database to access. Can I not access two
> databases within the same script?
I'm assuming that you're using localhost in both mysql_connect
statements. You may want to try using the new_link option of the
mysql_connect function. PHP might be trying to use your old (and
disconnected) link when you make your second connect call. Have a
look at the function call docs for details on using that option.
http://us4.php.net/mysql_connect