Re: pg_fetch_array problem - Mailing list pgsql-php

From scott.marlowe
Subject Re: pg_fetch_array problem
Date
Msg-id Pine.LNX.4.33.0208081103500.24001-100000@css120.ihs.com
Whole thread Raw
In response to Re: pg_fetch_array problem  ("David C. Brown" <dbrown@centennialwines.com>)
List pgsql-php
On Thu, 8 Aug 2002, David C. Brown wrote:

> hmm.. you could try..
>
> for(var i=0; $dados = pg_fetch_array($limite, $i); i++) {
>      $nome = $dados["nome"];
>       echo "Name: $nome<BR>";
> }
>
> I believe your error is your not passing pg_fetch_array() the row you
> wish to return.  It *may* or may not work that way.  But leaving it open
> like that is sure to cause an error sooner or later.

Actually, no.  In the latest and greatest version of PHP, pg_fetch_array
returns false when it runs out of rows, so you can just use:

while ($row = pg_fetch_array){
    dosomething here...
}


pgsql-php by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: pg_fetch_array problem
Next
From: angelo.rigo@globo.com
Date:
Subject: off topic rollback