Re: PHP & PostgreSQL

From: CoL <col(at)mportal(dot)hu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: PHP & PostgreSQL
Date: 2002-12-30 12:58:06
Message-ID: aupfei$2kkb$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Check the manual, it is very very good.

Boget, Chris wrote, On 12/30/2002 11:06 AM:
> * MySQL has a function to reset the result set so that it can be
> iterated through again - mysql_data_seek(). I don't see that there
> is a similar function for PGSQL. Is that true? If so, in order to
> reset the result set you have to perform the query again? Isn't
> that a waste of resources?
pg_fetch ... has a second parameter
array pg_fetch_array ( resource result [, int row [, int result_type]])
...
row is row (record) number to be retrieved. First row is 0.
$b=0;
while(pg_fetch_row($result,$b++)){} so you can seek where ever you want.

> * For PGSQL, you can get the database name, the field name
> even the *host name* but you can't get the table name from a
> particular query?
now check postgres manual, or once the php manual, how to get table
names, or etc.
http://www.php.net/manual/en/ref.pgsql.php
Comment:
passion at monkey dot org
27-Jun-2001 07:53

....
for tables:
SELECT relname FROM pg_class WHERE relname !~ '^pg_' and relkind='r';

C.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Schuchardt 2002-12-30 12:58:58 can't create type lo (BLOB)
Previous Message Diogo de Oliveira Biazus 2002-12-30 12:52:56 Re: PHP & PostgreSQL