Re: Porting Code to Postgresql - Mailing list pgsql-general

From Dennis Gearon
Subject Re: Porting Code to Postgresql
Date
Msg-id 3F8D6B0B.9010900@fireserve.net
Whole thread Raw
In response to Re: Porting Code to Postgresql  (Richard Welty <rwelty@averillpark.net>)
Responses Re: Porting Code to Postgresql
Re: Porting Code to Postgresql
List pgsql-general
>$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);
   ...
}





pgsql-general by date:

Previous
From: Edmund Dengler
Date:
Subject: Re: SET within a function?
Next
From: Robby Russell
Date:
Subject: Re: How to Create View