This is right, maybe you can assign the db link to a session variable but this will work only for one specific user, but what would happen if you have around 100 users at the same time?? you will have 100 different connections to the db, and that will be slower. So, maybe you should try to avoid having too much queries in your php pages.

At 11:32 AM 7/3/2003 -0400, you wrote:
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 for details.

  Paul Chvostek                                             <[EMAIL PROTECTED]>
  Free PHP web hosting!                  

-- PHP Database Mailing List ( To unsubscribe, visit:

Jadiel Flores ------------------------- [EMAIL PROTECTED] (52-55) 52-29-80-34

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to