Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4231060
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T01:55:44+00:00 2026-05-21T01:55:44+00:00

I apologize if this is a little simple, but I’ve been googleing and googleing

  • 0

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));
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T01:55:45+00:00Added an answer on May 21, 2026 at 1:55 am

    It looks like a simple endless loop since you never change $FromDate or $ToDate so the while(...) never stops and you run out of memory since you always store the same date again and again.

    I think you want to rename $StartDate to $FromDate to get the behaviour you decried.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I apologize if this is a simple question but I've been unable to find
I apologize if this is a basic question, however I have been searching on
I apologize if this has already been asked a different way but I couldn't
I apologize if this is slightly off-topic. I'm hoping to find a software-as-a-service CRM
I'm new to SSRS, so I apologize if this question is too simple: I
I'm sure this has already been asked and answered so I apologize in advance
I apologize as this is so simple, I was working with my own XOR
I apologize if this question is a duplicate. I have read many other mysqli
First off, I apologize if this doesn't make sense. I'm new to XHTML, CSS
I apologize in advance if this question seems remedial. Which would be considered more

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.