Re: Porting Code to Postgresql

From: Dennis Gearon <gearond(at)fireserve(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Porting Code to Postgresql
Date: 2003-10-16 02:51:00
Message-ID: 3F8E0794.6020903@fireserve.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Welty wrote:

>On Wed, 15 Oct 2003 08:43:07 -0700 Dennis Gearon <gearond(at)fireserve(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2003-10-16 03:02:36 Re: SET within a function?
Previous Message Mike Leahy 2003-10-16 02:39:39 UPDATE table to a joined query...