Re: Database question
| From: | Paul Chvostek | Date: | Thu, 03 Jul 2003 15:32:16 +0000 |
| Subject: | Re: Database question | ||
| References: | 1 | Groups: | php.db php.general |
| Request: | Send a blank email to php-general+get-153892@lists.php.net to get a copy of this message | ||
On Thu, Jul 03, 2003 at 07:00:17AM -0700, Hardik Doshi wrote:
>
> Currently i am connecting the underlying database
> server from every php page. To reduce the connection
> overhead i am thinking to store the PEAR DB object
> into the registry (session) at the time of user login.
> Here i am connecting the Database only one time and
> rest of the time i am using the object stored in the
> memory.
Nice as it sounds, this won't work. I don't recall where it's
documented, but at least with MySQL (and I'm assuming with the others as
well), a database link identifier cannot be stored in a session variable
and then re-used by another session. Check out
http://www.php.net/features.persistent-connections
for details.
--
Paul Chvostek <paul@it.ca>
it.canada http://www.it.ca/
Free PHP web hosting! http://www.it.ca/web/