Re: Maximum execution time exceeded!

From: Date: Mon, 29 Jan 2001 22:45:37 +0000
Subject: Re: Maximum execution time exceeded!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-37164@lists.php.net to get a copy of this message
That loop will never end. Generally, the loop body should manipulate some part of the loop ending condition. initialize $i before the loop replace the second loop with "if($prescene2==0){$i++;}" Chakravarthy K Sannedhi wrote: > > hi all, > > when i am trying to calculate the number of rows with a '0' in a > particular column using the following code, it is giving the 'Maximum > execution time exceeded' message, eventhough after i gave > set_time_limit(60), it didn't worked, infact now it is even worse the > browser is getting siezed. > > $result=mysql_query("select * from mytable"); > while ($avgrow=mysql_fetch_array($result)) > { > $prescene2 = $avgrow["scene2"]; > $prescene4 = $avgrow["scene4"]; > $prescene5 = $avgrow["scene5"]; > $prescene7 = $avgrow["scene7"]; > $prescene8 = $avgrow["scene8"]; > $prescene9 = $avgrow["scene9"]; > $i = 1; > while ($prescene2 == 0) { > $i=$i+1; > } > } > printf ("Number of zeros=%d",$i); > > Can any one please help me with this. > > TIA > kalyan > > __________________________________________________ > Do You Yahoo!? > Yahoo! Auctions - Buy the things you want at great prices. > http://auctions.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#37164) next »