title: Generate 50 random-duration time intervals in MySQL or PHP, between two dates
body: <p>I am trying to insert a random list of 50 datetime ranges into a MySQL database. These date ranges must be between a specific start and end date, and they must be adjacent and ordered by time.</p>
  
  <p>Heres an example of the DB table I am trying to generate between <strong>2014-09-01 00:00:00</strong> - <strong>2014-10-12 23:59:59</strong>:</p>
  
  <pre><code>start_time                     end_time
  --------------------------------------------------------
  2014-09-01 00:00:00            2014-09-01 02:45:12  
  2014-09-01 02:45:13            2014-09-01 04:12:33
  2014-09-01 04:12:34            2014-09-02 12:12:20
  ....
  2014-10-12 23:30:13            2014-10-12 23:59:59
  </code></pre>
  
  <p>I am unsure if this can be done solely in MySQL or whether I would need a PHP script. Generating a list of random dates between dates is fine, its splitting the randomness up evenly between 50 entries that has me confused.</p>
  
  <p>Can this be done in MySQL and if so what would be the preferred method?</p>
  
  <p><strong>Edit:</strong>
  To explain my question better, I have a date range which i need to generate a list of 50 start and end dates between. I should have mentioned that, like my example, the start date must be immediately the next second after the previous end date.</p>