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                                             <[EMAIL PROTECTED]>
  it.canada                                            http://www.it.ca/
  Free PHP web hosting!                            http://www.it.ca/web/

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to