Fatal error: Maximum execution

-2

An error occurred while executing a code in Php

Fatal error: Maximum execution time of 30 seconds exceeded

$validade = mysql_query($sql) or die (mysql_error());

The code works perfectly. only that appears to me at the end. Not that it bothers me but only to try to solve

o Loop:

For ($contador = 0; $contador = 1; $contador++){
    
asked by anonymous 25.08.2014 / 17:53

3 answers

5

I find it strange to say that the code works perfectly because it gives a "fatal error" which means that the engine stopped processing the script due to an error. And it says it stopped processing because it takes more than 30 seconds to run. Too few people have the patience to wait half a minute for the response from the server. So I think it's better to see where the problem is that the script takes so long to run, instead of allowing more execution time.

    
25.08.2014 / 18:13
1

Your loop is wrong.

In the second parameter of for use == instead of = .

The way you did it is always changing the value of the variable $contador to 1 and never exiting for , generating an infinite loop.

for($contador = 0; $contador == 1; $contador++){
    
26.08.2014 / 20:29
0

Your code is taking more than 30 seconds to execute!

You can increase the execution timeout with the set_time_limit (seconds) .

    
25.08.2014 / 17:58