Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id CCA02475D03 for ; Tue, 28 May 2002 22:11:04 -0400 (EDT) Received: from socrates.catalyst.net.nz (socrates.catalyst.net.nz [203.96.153.226]) by postgresql.org (Postfix) with ESMTP id 9130B475CFB for ; Tue, 28 May 2002 22:11:01 -0400 (EDT) Received: from heidegger.catalyst.net.nz (hume.catalyst.net.nz [203.96.153.228]) by socrates.catalyst.net.nz (8.11.1/8.11.1/Debian 8.11.0-6) with ESMTP id g4T2B1225277; Wed, 29 May 2002 14:11:01 +1200 X-Authentication-Warning: socrates.catalyst.net.nz: Host hume.catalyst.net.nz [203.96.153.228] claimed to be heidegger.catalyst.net.nz Received: from 127.0.0.1 (ident=unknown) by heidegger.catalyst.net.nz with esmtp (masqmail 0.2.8) id 17CsvK-7Sz-00; Wed, 29 May 2002 14:10:50 +1200 Subject: Re: using CURSOR with PHP From: Andrew McMillan To: Jurgen Defurne Cc: PHP PostgreSQL In-Reply-To: <3CF3B04C.89224966@pandora.be> References: <3CF3B04C.89224966@pandora.be> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.5 Date: 29 May 2002 14:10:50 +1200 Message-Id: <1022638250.8777.17.camel@kant.mcmillan.net.nz> Mime-Version: 1.0 X-Archive-Number: 200205/104 X-Sequence-Number: 1236 On Wed, 2002-05-29 at 04:29, Jurgen Defurne wrote: > > However, the only thing that seems to be missing is a layer between CGI > and the database. If someone logs in to the system, this layer should > return a session key and provide a process which opens a connection to > the database and keeps this open until the user logs out. > > This should be transparent to the application programmer. Since normally > all traffic between PHP and postgreSQL goes via the pgsql library, > should it not be possible to add an interface which acts as pgsql and > handles these sessions and is able to communicate with the real pgsql > library, which will then be part of the running program ? > > In this way it should then be possible to open transactions across CGI > invocations and to work with cursors. > > Does anyone know if something like this exists as Free/OSS ? 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. Regards, Andrew. -- -------------------------------------------------------------------- Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267 Are you enrolled at http://schoolreunions.co.nz/ yet?