pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedConverting PHP function mysql_data_seek to PostgreSQL
2+ messages / 2 participants
[nested] [flat]
* Converting PHP function mysql_data_seek to PostgreSQL
@ 2001-11-18 05:24 Christopher Schreiber <chris@fast4gl.com>
0 siblings, 1 reply; 2+ messages in thread
From: Christopher Schreiber @ 2001-11-18 05:24 UTC (permalink / raw)
To: pgsql-php
Hi!
I have this little snipnet of PHP code that calls the mysql_data_seek
function, and I need to convert
it to something similar to work with PostgreSQL. This is used basically to
jump to a specific row
position for an open query. Do I need to define and use a cursor to do this
with Postgres?
function data_seek($pos,$query_id=-1) {
// goes to row $pos
if ($query_id!=-1) {
$this->query_id=$query_id;
}
return mysql_data_seek($this->query_id, $pos);
}
Thanks in advance, any pointers would be helpful.
Chris Schreiber
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Converting PHP function mysql_data_seek to PostgreSQL
@ 2001-11-18 16:55 Dan Wilson <phpPgAdmin@acucore.com>
parent: Christopher Schreiber <chris@fast4gl.com>
0 siblings, 0 replies; 2+ messages in thread
From: Dan Wilson @ 2001-11-18 16:55 UTC (permalink / raw)
To: chris@fast4gl.com; pgsql-php
You do not need an equivalent in Postgres... postgres functions use a row
counter to retrieve all data from the result set. You can skip around the
result set all you want... just provide the row you want in the function.
If you notice, all the pg_fetch_* functions require a row_number as well as
the pg_result function.
http://www.php.net/manual/en/function.pg-result.php
-Dan
: Hi!
:
: I have this little snipnet of PHP code that calls the mysql_data_seek
: function, and I need to convert
: it to something similar to work with PostgreSQL. This is used basically
to
: jump to a specific row
: position for an open query. Do I need to define and use a cursor to do
this
: with Postgres?
:
:
: function data_seek($pos,$query_id=-1) {
: // goes to row $pos
: if ($query_id!=-1) {
: $this->query_id=$query_id;
: }
: return mysql_data_seek($this->query_id, $pos);
: }
:
: Thanks in advance, any pointers would be helpful.
:
: Chris Schreiber
:
:
: ---------------------------(end of broadcast)---------------------------
: TIP 6: Have you searched our list archives?
:
: http://archives.postgresql.org
:
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-11-18 16:55 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-11-18 05:24 Converting PHP function mysql_data_seek to PostgreSQL Christopher Schreiber <chris@fast4gl.com>
2001-11-18 16:55 ` Dan Wilson <phpPgAdmin@acucore.com>
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