| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера