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

From Dennis Gearon
Subject Re: Porting Code to Postgresql
Date
Msg-id 3F8E0794.6020903@fireserve.net
Whole thread Raw
In response to Re: Porting Code to Postgresql  (Richard Welty <rwelty@averillpark.net>)
List pgsql-general
Richard Welty wrote:

>On Wed, 15 Oct 2003 08:43:07 -0700 Dennis Gearon <gearond@fireserve.net> wrote:
>
>
>
>>>$count = pg_numrows( $result);
>>>for( $i = 0; $i < $count; $i++){
>>>
>>>
>...
>
>
>>in case of no rows, maybe do:
>>
>>$count = pg_numrows( $result);
>>while ( 0 < $result ){
>>
>>
>...
>
>shouldn't make a difference; in php, the condition on a for() should be at
>the top of the loop anyway.
>
>richard
>
>
In a for loop, you *always* execute the body of the loop one time, as
far as I know. So if you have no rows, you would then have a problem.
That is why I put the WHILE at the top.

--
"You are behaving like a man",
is an insult from some women,
a compliment from an good woman.



pgsql-general by date:

Previous
From: Mike Leahy
Date:
Subject: UPDATE table to a joined query...
Next
From: Stephan Szabo
Date:
Subject: Re: SET within a function?