Re: using CURSOR with PHP

From: Jurgen Defurne <jurgen(dot)defurne(at)pandora(dot)be>
To: Andrew McMillan <andrew(at)catalyst(dot)net(dot)nz>
Cc: PHP PostgreSQL <pgsql-php(at)postgresql(dot)org>
Subject: Re: using CURSOR with PHP
Date: 2002-05-29 16:13:38
Message-ID: 3CF4FE32.54ED8C7D@pandora.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Andrew McMillan wrote:
> PHP implements a bunch of session handling functions. If you desire you
> can use the session ID from these to retrieve a record from the
> database.
>
> For myself, I have developed my own session handling, rather than use
> PHP's. This was perhaps not a good choice, but it is a path I went down
> some years ago now and it is hard to change :-)
>
> PHP sessions do not require the database to be there, of course,
> allowing you to stuff information into an in-memory session structure,
> but this limits the amount of information that can be associated easily.
>
> My own session management does use the database to hold session- and
> user- related information, retrieving (and possibly updating) for each
> page the user visits during their session.

I know what you mean and I have written also this kind of session
handling in Perl, storing session data between CGI invocations in the
file system. One should even be able to define a generic interface and
provide drivers to plug in one's favorite database tool (eg. a
filesystem driver, a DBM driver, a mySQL driver, a postgreSQL driver).

However, that is not what I meant. The type of session management I was
referring to should create a process for every user logged on to the
system. This process should keep the backend from the pgsql database
alive and act as a gateway from PHP to postgreSQL, so that across CGI
invocations you could do the following :
- Startup your connection
- Enter a screen which starts a transaction
- Change data in several screens (still for the same transaction)
- Finally in the last screen, COMMIT or ROLLBACK your transaction

Starting a process, getting a socket and passing the TCP/IP number and
socket back as a session key should not be that hard (I have written
servers in Perl). Then, the interface from PHP should be able to pass
it's pgsql requests to the process using the TCP/IP number and the
socket. It should even be possible to do it synchronous or asynchronous.

It is of course an itch to scratch, but for the moment I am planning the
IT infrastructure of a school (we can start from nil, a good time to put
everything under Linux and OOo).

Regards,

Jurgen Defurne

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Julio Cuz, Jr. 2002-05-29 20:46:01 MSSQL & PHP
Previous Message David C. Brown 2002-05-29 15:08:26 Re: variable visibility when using <a href></a>