>$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);
...
}
or
$count = pg_numrows( $result);
$offset = $count;
while ( 0 < $offset ){
$offset--;
$row = pg_fetch_object( $result-$offset, $row);
...
}