Re: PHP & PostgreSQL

Поиск
Список
Период
Сортировка
От CoL
Тема Re: PHP & PostgreSQL
Дата
Msg-id aupfei$2kkb$1@news.hub.org
обсуждение исходный текст
Ответ на PHP & PostgreSQL  ("Boget, Chris" <chris@wild.net>)
Список 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 по дате отправления:

Предыдущее
От: Ed Loehr
Дата:
Сообщение: missing 7.3.1 pg_hba.conf examples
Следующее
От: Hadley Willan
Дата:
Сообщение: Re: no space left on device