DaVuLf Posted May 27, 2006 Share Posted May 27, 2006 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:[code]Fatal error: Maximum execution time of 30 seconds exceeded in /home/content/b/r/i/briancomeau/html/wdt/insert.php on line 225[/code]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. Quote Link to comment Share on other sites More sharing options...
fenway Posted May 27, 2006 Share Posted May 27, 2006 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 Link to comment Share on other sites More sharing options...
DaVuLf Posted May 27, 2006 Author Share Posted May 27, 2006 [!--quoteo(post=377684:date=May 27 2006, 07:52 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ May 27 2006, 07:52 PM) [snapback]377684[/snapback][/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. Quote Link to comment Share on other sites More sharing options...
DaVuLf Posted May 28, 2006 Author Share Posted May 28, 2006 Was an infinate loop within a 'for'. Here is another question. Why does MySQL sort like this:[code]name value balance worth Descending idBrian 0 97706.8 97706.8 22Wussie 0 117717.75 117717.75 18Woo 0 107069.14 107069.14 21Team1 0 106361.44 106361.44 17Paco 0 103765 103765 19Taco 0 102943.42 102943.42 20[/code]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 Quote Link to comment Share on other sites More sharing options...
DaVuLf Posted May 28, 2006 Author Share Posted May 28, 2006 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 :). Quote Link to comment Share on other sites More sharing options...
fenway Posted May 28, 2006 Share Posted May 28, 2006 DOUBLE? Sounds like you should be using DECIMAL -- no need to have that much precision for what seems like a currency field. Quote Link to comment Share on other sites More sharing options...
DaVuLf Posted May 28, 2006 Author Share Posted May 28, 2006 [!--quoteo(post=377884:date=May 28 2006, 01:30 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ May 28 2006, 01:30 PM) [snapback]377884[/snapback][/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\" /][b]Edit:[/b] 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! Quote Link to comment Share on other sites More sharing options...
fenway Posted May 28, 2006 Share Posted May 28, 2006 There are different storage requirements -- see [a href=\"http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html\" target=\"_blank\"]here[/a]. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.