title: Finding the calendar date of an ongoing event when the start-date and weekday are known
body: <p>I'm trying to create a schedule of unique, recurring events that cycle on a weekly basis (each event will have unique identifiers and repeat weekly).</p>
  
  <p>In addition to other information gathered about each event, I will gather the weekday on which each event will take place and the dates (calendar dates) on which the event will begin and end.</p>
  
  <p>An example:</p>
  
  <pre><code>Event:       Go to gym    (the event I plan to do once a week)
  Day of Week: Sunday       (day of week event will occur (every Sunday))
  Start Date:  2014-09-01   (happens to be a Monday)
  End Date:    2015-08-31   (...)
  </code></pre>
  
  <p>The purpose is to write a script that takes any multitude of events and their respective weekday/start/end date and recreate a calendar depicting the future calendar dates on which each event will occur.</p>
  
  <pre><code>So the first date I should see scheduled to go to the gym will be:
  2014-09-07
  because this is first Sunday following the start date.
  </code></pre>
  
  <p>To sum it up, I am gathering the weekday of each event as well as the start and end dates. How can I parse these pieces of data into something that spits out a list of the events' future dates of reoccurrence?</p>
  
  <p>Keep in mind that there will be a vast number of events that will occur on different days of the week and have different start/end dates.</p>
  
  <p>Thank you for all who read and respond.</p>
  
  <p>Tried:</p>
  
  <pre><code>SQL: grouping, different select statements, and stuff
  PHP: stuff, date/time stuff, and stuff stuff
  </code></pre>