Re: Making a database connection persists in PHP

From: "Michael Swierczek" <mike(dot)swierczek(at)gmail(dot)com>
To: "Mary Anderson" <maryfran(at)demog(dot)berkeley(dot)edu>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Making a database connection persists in PHP
Date: 2008-04-01 02:10:37
Message-ID: 68b5b5880803311910p66fda93cw75fe07c140996619@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Mary,
I think this is more of a PHP question than a Postgres question.
I believe you can put the question in a session variable. You may
also want to investigate connection pooling, where your application
keeps a set of open connections and then each time a request needs a
connection, it grabs one from the pool, uses it, and then gives it
back. A web search on connection pooling and PHP should tell you
what you need.
Good luck.

-Mike

On 3/31/08, Mary Anderson <maryfran(at)demog(dot)berkeley(dot)edu> wrote:
> Hi all,
> Don't know if this should go to the PHP group or the postgresql group
>
> I am writing a PHP-postgres application. I would like to have a
> database connection persists across php pages. What the application
> does at present is to create a new connection every time a new page is
> called. Can I put a connection into a session variable?
>
> Thanks
>
> Mary Anderson
>
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Mat Dodgson 2008-04-01 12:15:19 copy command in Windows XP
Previous Message Mary Anderson 2008-03-31 23:48:17 Making a database connection persists in PHP