On Wed, 15 Oct 2003, Dennis Gearon wrote:

> 
> >$count = pg_numrows( $result);
> >for( $i = 0; $i < $count; $i++){
> >    $row = pg_fetch_object( $result, $row);
> >    ...
> >}
> >
> >if you want it to work.
> >
> >  
> >
> in case of no rows, maybe do:
> 
> $count = pg_numrows( $result);
> while ( 0 < $result ){
>    $result--;
>    $row = pg_fetch_object( $result, $row);
>    ...
> }

But you don't want to decrement $result, it's a result handle, you want to 
decrement count:

$count = pg_numrows( $result);
 while ( 0 < $count ){
    $count--;
    $row = pg_fetch_object( $result, $row);
    ...
}



---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to