TeddyKiller Posted April 14, 2010 Share Posted April 14, 2010 This script keeps giving a Fatal error. Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\uni\event.php on line 51 Whats the problem? >.< function GetDays($sStartDate, $sEndDate){ $sStartDate = gmdate("Y-m-d", $sStartDate); $sEndDate = gmdate("Y-m-d", $sEndDate); $aDays[] = date("d", strtotime($sStartDate)); $sCurrentDate = $sStartDate; while($sCurrentDate < $sEndDate){ $sCurrentDate = gmdate("Y-m-d", strtotime("+1 day", strtotime($sCurrentDate))); $aDays[] = date("d", strtotime($sCurrentDate)); } return $aDays; } $event_txt = "Dates for this holiday!<br />" . implode(", ", GetDays(strtotime($ev["event_start"]), strtotime($ev["event_end"]))) . ""; echo $event_txt; Quote Link to comment Share on other sites More sharing options...
Deoctor Posted April 14, 2010 Share Posted April 14, 2010 change the value of max_execution_time to some higher value in the php.ini Quote Link to comment Share on other sites More sharing options...
xt3mp0r~ Posted April 14, 2010 Share Posted April 14, 2010 Easiest way would be to add following code at beginning of your code. set_time_limit(0); Quote Link to comment Share on other sites More sharing options...
ChemicalBliss Posted April 14, 2010 Share Posted April 14, 2010 I would reccommend a flush() now and then to make sure its working properly. cb 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.