Fatal error: Maximum execution time of 30 seconds

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
Supper Baby
Forum Commoner
Posts: 27
Joined: Tue Aug 01, 2006 11:33 pm

Fatal error: Maximum execution time of 30 seconds

Post by Supper Baby »

Hello again :lol:

I had that error in my script :

Code: Select all

Fatal error: Maximum execution time of 30 seconds exceeded in C:\AppServ\www\XXX\coreClasses\MySQL.Class.php on line 68
Yab, my script doing a lot of loop, that's right it handle a lot of Big array, But certainly not at the index page there is no large work there.

Only 1 SQL Query will get 1 result from it.

Why the script reach the time execution limit ?

How can I know why ?

Thanks for your time :wink:
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

Show us your code :P
Supper Baby
Forum Commoner
Posts: 27
Joined: Tue Aug 01, 2006 11:33 pm

Post by Supper Baby »

:lol: you can find a copy of it here http://www.fbi.gov

I own this site : http://www.fbi.gov <<======== :D don't know how to lie

I belief any of you can tell me how to figure the error and Debug the code (Without seeing the code of course :D).
Supper Baby
Forum Commoner
Posts: 27
Joined: Tue Aug 01, 2006 11:33 pm

Post by Supper Baby »

BTW: can you tell me what you try to say in your signature
Don't document your code, code your documentation
<<======== Newbie
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

Supper Baby wrote::lol: you can find a copy of it here http://www.fbi.gov

I own this site : http://www.fbi.gov <<======== :D don't know how to lie
:? :?: :? :?:
Supper Baby wrote:I belief any of you can tell me how to figure the error and Debug the code (Without seeing the code of course :D).
Really? How are we supposed to do that?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

Supper Baby wrote:BTW: can you tell me what you try to say in your signature
How can I explain it better? Ok, I'll try... You need to think and make a plan before you start to code. The first part of the signature is a joke... you still need to document your code :wink:
Supper Baby
Forum Commoner
Posts: 27
Joined: Tue Aug 01, 2006 11:33 pm

Post by Supper Baby »

Oren wrote:
Supper Baby wrote:BTW: can you tell me what you try to say in your signature
How can I explain it better? Ok, I'll try... You need to think and make a plan before you start to code. The first part of the signature is a joke... you still need to document your code :wink:
I see :) you'r right we must code our documentation

Thanks for your help
Supper Baby
Forum Commoner
Posts: 27
Joined: Tue Aug 01, 2006 11:33 pm

Post by Supper Baby »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I resolved the problem    but I need to know Why ?

this is My code :

Code: Select all

$result = mysql_query( $q, $this->conn_id );
While ( $row = mysql_fetch_array( $result , MYSQL_ASSOC ) )
{

$title[] = $row[title];
$location = GetLocation( $row[location] );

}
Here is GetLocation function :

Code: Select all

Function GetLocation($LocationID)
{
$result = mysql_query( $q, $this->conn_id );
$row = mysql_fetch_array( $result , MYSQL_ASSOC );
return $row;
}
I resolved the problem by run the GetLocation function after While statement.

The question is why the script confused when I do the query inside other query loop ?


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

That's probably not the complete code of the functions (or e.g. where does $q come from?)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You really need to show more code. I would guess that you are running a query that has quiet a few results, and while you are looping that result set, you are running another query within that loop, and you are trying to loop the second result set as well. But that is just a guess since you really haven't posted enough code to make a good assessment of your problem.
Post Reply