Re: Re: DB: Changing database during script execution
| From: | Tomas V.V.Cox | Date: | Mon, 22 Jul 2002 12:35:12 +0000 |
| Subject: | Re: Re: DB: Changing database during script execution | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7842@lists.php.net to get a copy of this message | ||
Martin Jansen wrote:
>
> On Mon, 22 Jul 2002 10:46:38 +0200, Martin Jansen wrote:
>
> >What is the recommened way to change the database while executing a
> >script using PEAR DB?
>
> For the notes: I already tried $dbh->_db = 'new_db' and that's working
> of course, but IMO this is no elegant solution at all.
>
What about:
$db->disconnect();
$db = DB::connect($new_dsn);
Tomas V.V.Cox