Re: pg_fetch_array()

Поиск
Список
Период
Сортировка
От scott.marlowe
Тема Re: pg_fetch_array()
Дата
Msg-id Pine.LNX.4.33.0212181455320.4045-100000@css120.ihs.com
обсуждение исходный текст
Ответ на pg_fetch_array()  (Thorsten Haude <postgresql@thorstenhau.de>)
Список pgsql-php
On Wed, 18 Dec 2002, Thorsten Haude wrote:

> Hi,
>
> I want to read an unknown number of rows from a select result. I try
> this:
> - - - Schnipp - - -
> $result = pg_exec($dbh, $statement);
> $row = 0;
> while ($item = pg_fetch_array($result, $row, PGSQL_ASSOC))
> {
>     doSomething($item);
>     $row++;
> }
> - - - Schnapp - - -

Wrap your while loop in this test:

if (pg_num_rows($result)>0){

}


It may be you're not getting any rows back here.



В списке pgsql-php по дате отправления:

Предыдущее
От: "joerg.niemann"
Дата:
Сообщение: Re: pg_fetch_array()
Следующее
От: Thorsten Haude
Дата:
Сообщение: Re: pg_fetch_array()