Timeout in nested loops

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
colmtourque
Forum Newbie
Posts: 20
Joined: Wed Aug 25, 2004 11:59 am

Timeout in nested loops

Post by colmtourque »

I have a set of nested loops inside one of the loops I would like to make a submitable form, as such:

Code: Select all

$count=0
while (!$rsact->EOF)
{
$count=$count+1
$count2
//Data here
       while (!$rsact2->EOF)
       {
       $count2=$count2+1
       $rsact2->MoveNext(); 
        //Data
        //FORMS HERE form name changes with each count2
        }
$rsact->MoveNext(); 
}
The page tends to timeout when I enter the inner count. If I move count2 to the outer loop it does the same thing.
Setting the timeout to higher does not help any. Are there any suggestions to seting up forms dynamically like this or how to end the timeout.

thanks in advance for any help.
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

ok here is a question....does $rsact or $rsact2 ever hit the EOF limit or is it always at a point before the EOF, for the loop to resolve !$rsact->EOF has to become $rsact->EOF and !$rsact2->EOF has to become $rsact2->EOF...does this happen?
colmtourque
Forum Newbie
Posts: 20
Joined: Wed Aug 25, 2004 11:59 am

Post by colmtourque »

The loop works so long as I do not put $count2=$count2+1 inside the second loop.

So $rsact and $rsact2 hit EOF fine.
Post Reply