Page 1 of 1

Fatal error: Maximum execution time of 30 seconds

Posted: Sat Aug 26, 2006 4:33 am
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:

Posted: Sat Aug 26, 2006 4:36 am
by Oren
Show us your code :P

Posted: Sat Aug 26, 2006 4:48 am
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).

Posted: Sat Aug 26, 2006 4:51 am
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

Posted: Sat Aug 26, 2006 4:55 am
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?

Posted: Sat Aug 26, 2006 5:07 am
by volka

Posted: Sat Aug 26, 2006 6:49 am
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:

Posted: Sat Aug 26, 2006 7:33 am
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

Posted: Sat Aug 26, 2006 8:57 pm
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]

Posted: Sun Aug 27, 2006 3:23 am
by volka
That's probably not the complete code of the functions (or e.g. where does $q come from?)

Posted: Sun Aug 27, 2006 3:28 am
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.