title: Do a SELECT on all tables between 2 dates
body: <p>I have a Mysql Database with a table for each day, it goes this way: <code>my_table_20130310</code>, <code>my_table_20130311</code> ...</p>
  
  <p>I want to do a select on all tables let's say between '2013/02/02' and '2013/03/28'</p>
  
  <p>There is this stupide solution, which is to transform given dates into this: </p>
  
  <pre><code>'2013/02/02' =&gt; 20130202
  
  '2013/03/28' =&gt; 20130328
  </code></pre>
  
  <p>cast then into (int) and then do a loop:</p>
  
  <pre><code>      $dbStartDate  = str_replace('/', '', substr($startDate, 0, 10));
        $dbEndDate    = str_replace('/', '', substr($endDate, 0, 10));
  
        for ($tbDate = $dbStartDate; $tbDate &lt;= $dbEndDate ; $tbDate++) { 
          $res = 'SELECT * FROM my_table_' . $tbDate ;
          ...
          ... 
        }
  </code></pre>
  
  <p>But this is not a solution since it will try to parse all numbers between 20130202 and 20130328 (20130299, 20130245....)</p>
  
  <p>An Idea ?</p>
  
  <p>Thx guys</p>