Re: PHP & PostgreSQL - Mailing list pgsql-general

From CoL
Subject Re: PHP & PostgreSQL
Date
Msg-id aupfei$2kkb$1@news.hub.org
Whole thread Raw
In response to PHP & PostgreSQL  ("Boget, Chris" <chris@wild.net>)
List 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.


pgsql-general by date:

Previous
From: Ed Loehr
Date:
Subject: missing 7.3.1 pg_hba.conf examples
Next
From: Hadley Willan
Date:
Subject: Re: no space left on device