Jump to content


Photo

Fatal Error: Time over 30seconds... Hmm...


  • Please log in to reply
7 replies to this topic

#1 DaVuLf

DaVuLf
  • Members
  • PipPipPip
  • Advanced Member
  • 124 posts

Posted 27 May 2006 - 09:25 PM

I've just recently started getting this error, so I'm not quite sure what is up. I'm not going to post the code since it is 352 lines and will not fit. Instead, here is the link to download the php file.

[a href=\"http://www.briancomeau.net/wdt/insert.php\" target=\"_blank\"]FILE[/a]

I get the following error:
Fatal error: Maximum execution time of 30 seconds exceeded in /home/content/b/r/i/briancomeau/html/wdt/insert.php on line 225

I think it means that I have too much going on, but I'm not really sure how to reduce this. Any help would be appreciated.

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 27 May 2006 - 11:52 PM

I was about to say that it's probably a select query that takes too long to run, but it seems like an insert page. Hard to say... what types of SQL statements are you running?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 DaVuLf

DaVuLf
  • Members
  • PipPipPip
  • Advanced Member
  • 124 posts

Posted 27 May 2006 - 11:57 PM

[!--quoteo(post=377684:date=May 27 2006, 07:52 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ May 27 2006, 07:52 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I was about to say that it's probably a select query that takes too long to run, but it seems like an insert page. Hard to say... what types of SQL statements are you running?
[/quote]

Take a look at the file, it should be pretty self explanatory.

I run about.. 15 different queries within the file. I update/select 3 different tables.

#4 DaVuLf

DaVuLf
  • Members
  • PipPipPip
  • Advanced Member
  • 124 posts

Posted 28 May 2006 - 02:15 AM

Was an infinate loop within a 'for'. Here is another question. Why does MySQL sort like this:

name         value         balance         worth Descending         id
Brian      0     97706.8     97706.8     22
Wussie     0     117717.75     117717.75     18
Woo      0     107069.14     107069.14     21
Team1     0     106361.44     106361.44     17
Paco       0     103765     103765     19
Taco       0     102943.42     102943.42     20

So.. It's sorted Descending, but the 97706.8 is on top. I tried re-sorting, or tried by ascending, but that number is always in the wrong place.

Any ideas?

Thanks,
DaVuLf

#5 DaVuLf

DaVuLf
  • Members
  • PipPipPip
  • Advanced Member
  • 124 posts

Posted 28 May 2006 - 02:34 AM

Well, it seems that my Googling has once again paid off. The solution was to make sure my field was a DOUBLE (was varchar). Works now :).

#6 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 28 May 2006 - 05:30 PM

DOUBLE? Sounds like you should be using DECIMAL -- no need to have that much precision for what seems like a currency field.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#7 DaVuLf

DaVuLf
  • Members
  • PipPipPip
  • Advanced Member
  • 124 posts

Posted 28 May 2006 - 08:28 PM

[!--quoteo(post=377884:date=May 28 2006, 01:30 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ May 28 2006, 01:30 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
DOUBLE? Sounds like you should be using DECIMAL -- no need to have that much precision for what seems like a currency field.
[/quote]

Didn't know there was such a field. Double is to 16 places, right? Isn't it the slightly less precise version of Float?

I can't remember these things from when I used to write Java last year. [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /]

Edit: Can I store a Double number (ie, more than 2 decimals) in a Decimal field? If so, does it just truncate the rest of the numbers? Otherwise, is there a toDecimal ($var); type code somewhere? Also, is there really a difference... I mean, I don't really have a problem with it being in Double, but if it saves space or something, then I might change.

Thanks!

#8 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 28 May 2006 - 09:10 PM

There are different storage requirements -- see [a href=\"http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html\" target=\"_blank\"]here[/a].
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users