title: MySQL Query to automatically populate permanent events into a table without repeating the input process
body: <p>I'm using MySQL dB and two tables are named "perm_events" for the repeated events and "reservations" to store the individual events that do not repeat, respectably. The "perm_events" table exists for the sole purpose of NOT having to type in the same information repeatedly. This is a question regarding the "perm_events".</p>
  
  <p>For example:</p>
  
  <ul>
  <li>Event A: Scheduled to go on every Sunday, 8am to 9am indefinitely.</li>
  <li>Event B: Scheduled for every Tuesday, Thursday, between 12/1/2019 and 12/31/2019.</li>
  </ul>
  
  <p>I'm using PHP UI to gather the information about events and I want to write a query base on the information collected from the UI. </p>
  
  <p>Info gathered: (This will be stored in "perm_events" table.)</p>
  
  <pre><code>Event name: Event B
  Location:   Rm. 1
  Start time:  9:00AM
  End Time:   10:00AM
  Weekdays:   Tue, Thu
  Start Date: 12/1/2019 (If NULL, the event is permanent)
  End Date:   12/31/2019
  </code></pre>
  
  <p>Base on the collected info above, I want to populate a table containing the below:</p>
  
  <pre><code>   DATE    WKDAY EVENT NAME LOCATION STARTING_TIME ENDING_TIME 
  ---------- ----- ---------- -------- ------------- -----------
  12/03/2019  TUE   EVENT B     Rm. 1    9:00AM        10:00AM
  12/05/2019  THU   EVENT B     Rm. 1    9:00AM        10:00AM
  12/10/2019  TUE   EVENT B     Rm. 1    9:00AM        10:00AM
  12/12/2019  THU   EVENT B     Rm. 1    9:00AM        10:00AM   
                              .
                              . 
  12/31/2019  TUE   EVENT B     Rm. 1    9:00AM        10:00AM
  </code></pre>
  
  <p>Currently, I am entering the ABOVE event as a series of events for the duration from 12/3/2019 through 12/31/2019, as the UI shown below (The below are stored in "reservations" table):</p>
  
  <pre><code>event_name: Event B(1)
  location: Rm. 1
  start_time: 9:00AM
  end_time: 10:00AM
  date: 12/3/2019
  end_date: 12/31/2019
  (Reserve Button)
  </code></pre>
  
  <p>After reserving this event, I'd go on to the next by repeating the process until the process is complete - as shown below.</p>
  
  <pre><code>event_name: Event B(2)
  location: Rm. 1
  start_time: 9:00AM
  end_time: 10:00AM
  date: 12/5/2019
  end_date: 12/31/2019
  (Reserve Button)
  .
  .
  and so on...
  </code></pre>
  
  <p>I'd have to do this seemingly endless process until the process is complete (I think there are 8 or 9 in the above example). Moreover, for the permanent events that DO NOT have END DATES, I'd have to continually enter the same event information over-and-over again. </p>
  
  <p>Simply put, I am looking to save time by <strong>NOT</strong> entering the event information repeatedly for an extended event or permanent event - one-by-one. It would be much more efficient process. </p>
  
  <p>How do I go about doing this? </p>
  
  <p>thank you in advance to all the experts who'll read my question.</p>