title: How to create repeatable event php/mysql (weekly)
body: <p>I am trying to create an event which should repeat every week at the same time.</p>
  
  <p><strong>This is what I have right now</strong>:</p>
  
  <p>User sends <code>postString</code> to my php script looking like this:</p>
  
  <pre><code>weekly=true&amp;dateFrom=2016-10-01 14:00&amp;dateTo=2016-10-01 15:00&amp;usrId=1
  </code></pre>
  
  <p>Then my MySQL statement with php script insert these data to MySQL DB.
  This is my inserting function:</p>
  
  <pre><code>public function newEvent($weekly, $dateFrom, $dateTo, $usrId) {
  
      $sql = "insert into myTableName set weekly=?, dateFrom=?, dateTo=?, usrId=?";
      $statement = $this-&gt;conn-&gt;prepare($sql);
      if (!$statement)
          throw new Exception($statement-&gt;error);
      $statement-&gt;bind_param("ssss", $weekly, $price, $sport, $participants, $latitude, $longitude, $description, $dateFrom, $dateTo, $usrId, $title);
      $returnValue = $statement-&gt;execute();
      return $returnValue;
  }
  </code></pre>
  
  <p>It works fine , but my <strong>actual goal is</strong>:</p>
  
  <p>When user sends <code>postString</code> like example above and if <strong><em>weekly is true</em></strong>
  I would like my event to repeat every week at the same time and I would like to be able to search the event in some future week.</p>
  
  <p><strong>Example</strong>: My <code>weekly=true&amp;dateFrom=2016-10-01 14:00&amp;dateTo=2016-10-01 15:00&amp;usrId=1</code> is like this and if I ran this MySQL statement </p>
  
  <pre><code>SELECT *
      FROM myTableName WHERE dateFrom &gt;= 2016-10-08 13:00 
          AND dateTo &lt;= 2016-10-08 16:00 LIMIT 0 , 30
  </code></pre>
  
  <p>I would like to get the data from my event which had time <code>dateFrom=2016-10-01 14:00&amp;dateTo=2016-10-01 15:00</code> when it was created.</p>
  
  <p>My question is:</p>
  
  <p><strong>Is there any way how can I accomplish the thing I have just described?</strong></p>
  
  <p>If you need more details just let me know. 
  Thank you very much :)</p>