From: Rod Taylor <rbt@rbt.ca>
To: akopciuch@olympusproject.org
Cc: sebastien.baudry@baudry-engineering.com, Sebastien BAUDRY <sbaudry@yahoo.com>
Cc: pgsql-php@postgresql.org
Subject: Re: How to manipulate a cursor returned by a PL/pgSQL in a PHP
Date: Sun, 05 Oct 2003 08:22:02 -0400
Message-ID: <1065356520.23288.144.camel@jester> (raw)
In-Reply-To: <200310050238.37577.akopciuch@olympusproject.org>
References: <20031005073201.91481.qmail@web13807.mail.yahoo.com>
<200310050238.37577.akopciuch@olympusproject.org>
On Sun, 2003-10-05 at 04:38, Andrew J. Kopciuch wrote:
> On Sunday 05 October 2003 01:32, Sebastien BAUDRY wrote:
> > Hi.
> > My function returns a cursor and I don't know how to
> > fetch the cursor in my PHP script.
> > Anybody could help me?
> >
>
> PHP does not directly support cursors under PostgreSQL. :-(
Huh? Cursors in PostgreSQL are accessible via the standard query
interface within PHP.
It's 2 queries, one to create the cursor, one to request the number of
tuples. PHP does not need any special logic to handle this.
pg_query('DECLARE thecursor CURSOR FOR ....')
pg_query('FETCH ...');
The fetch will act just like a select in regards to returned data.
Attachments:
signature.asc (application/pgp-signature, 186B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: rbt@rbt.ca, akopciuch@olympusproject.org, sbaudry@yahoo.com
Subject: Re: How to manipulate a cursor returned by a PL/pgSQL in a PHP
In-Reply-To: <1065356520.23288.144.camel@jester>
References: <20031005073201.91481.qmail@web13807.mail.yahoo.com> <200310050238.37577.akopciuch@olympusproject.org> <1065356520.23288.144.camel@jester>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox