title: Mysql recurring event parameters unknown
body: <p>I have a MySQL database linked to a scheduling program. When an appointment is made, it is saved in a table called bookings. Even though the appointment is recurring, it is saved as one row. There is a formula that classifies what kind of recurring event it is (once a week, twice a week, once a month, etc.). From the manual, all the parameters are as follow: </p>
  
  <ul>
  <li>s - single event.</li>
  <li>d1 - every weekday.</li>
  <li>d - every day.</li>
  <li>wx-y - every x weeks on y. y corresponds to an 8 bit representation of
  the weekdays (Sunday is 1, Monday is 2, Tuesday is 4, Wednesday is 8,
  Thursday is 16, Friday is 32, Saturday is 64).</li>
  <li>mdx - every x months.</li>
  <li>mx-y-z - the xth y of every z months. x can be first (0), second (1),
  third (2), fourth (3) or last (4). y corresponds to the weekday (Sunday
  is 1, Monday is 2...Saturday is 7).</li>
  </ul>
  
  <p>I created a PHP script that queries from the "bookings" table, but will only bring up the one appointment that shows the start date and end date. It is followed by a "freq" column, but I do not have a function or set of parameters that can translate that into querying all the recurring events from the start date to the end date. Also, the "startdate" and "enddate" columns are in "datetime" format (yyyy-mm-dd 00:00:00).</p>
  
  <p>P.S.
  I can't post a picture because I am a new member, but I have 5 examples. </p>
  
  <ol>
  <li>"w1-32" is once a week on Fridays; </li>
  <li>"w1-8" is once a week on Wednesdays; </li>
  <li>"d" is a daily appointment; </li>
  <li>"d1" is only on weekdays; 
  5"w10-4" is every 10 weeks on Tuesdays.  </li>
  </ol>