I apologize if this is a little simple, but I've been googleing and googleing and just can't seem to find what I'm looking for.
I have a calendar script that allows users to upload events lasting more than one day. It stores the events in a mysql database table that stores the from date and to date in separate columns.
When I attempt to pull the dates from the table and store the days as an array, including those between the from/to dates, so that they can be highlighted in the calendar the script times out telling me that it ran out of memory on the line where dates between the from/to dates. Surely that can't be right as the table only holds my test event and it only lasts one week.
There may be an easier way of doing it all together and I wouldn't be at all surprised if there were other problems with my script, so any and all input is very much welcome. Thanks!
Here's the snipet:
$FromDate=date("Y-m-d", strtotime($Calendar['FromDate']));
$ToDate=date("Y-m-d", strtotime($Calendar['ToDate']));
while($FromDate < $ToDate){
// below is the line it times out on.
$StartDate=date("Y-m-d", strtotime("+1 day", strtotime($FromDate)));
$EventDays[]=date("d", strtotime($StartDate));
}
$FromDate, so$FromDate <$ToDate` is always true.