Re: Porting Code to Postgresql

Поиск
Список
Период
Сортировка
От Dennis Gearon
Тема Re: Porting Code to Postgresql
Дата
Msg-id 3F8E0794.6020903@fireserve.net
обсуждение исходный текст
Ответ на Re: Porting Code to Postgresql  (Richard Welty <rwelty@averillpark.net>)
Список 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 по дате отправления:

Предыдущее
От: Mike Leahy
Дата:
Сообщение: UPDATE table to a joined query...
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: SET within a function?