Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 5926E475C5D for ; Sat, 18 May 2002 06:37:07 -0400 (EDT) Received: from heidegger.catalyst.net.nz (203-96-145-72.adsl.paradise.net.nz [203.96.145.72]) by postgresql.org (Postfix) with ESMTP id 21889475BC2 for ; Sat, 18 May 2002 06:37:05 -0400 (EDT) Received: from 127.0.0.1 (ident=unknown) by heidegger.catalyst.net.nz with esmtp (masqmail 0.2.8) id 1791ZC-0HI-00; Sat, 18 May 2002 22:36:02 +1200 Message-ID: <3CE62E92.4000002@catalyst.net.nz> Date: Sat, 18 May 2002 22:36:02 +1200 From: Andrew McMillan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc2) Gecko/20020515 Debian/1.0rc2-2 X-Accept-Language: en, en-au, en-us MIME-Version: 1.0 To: Eckhard Hoeffner Cc: PHP PostgreSQL Subject: Re: using CURSOR with PHP References: <20020518072624.GA16938@fifoost.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200205/57 X-Sequence-Number: 1189 Eckhard Hoeffner wrote: > Does anyone has a solution to use the CURSOR function with PHP. The > main problem - in my opinion - is, that the CURSOR must be closed > and if the database is accessed from a web browser, this can not be > ensured. > I don't use cursors in web applications myself, since PostgreSQL supports the excellent "SELECT ... LIMIT OFFSET " syntax in all of the cases where I might otherwise have done so. That's my experience to date, anyway - I'm prepared to find somewhere a cursor might be a requirement - I know that if you wanted to write cross-database portable code you would probably need to work with them. Regardless, unless you open your database connection as a persistent connection, the database connection will be closed when the script finishes, and that should clean up all that is necessary. 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?