title: Fetch mysql data from start till current month
body: <p>I have a mysql table <code>tbl_track</code> with a lot of records</p>
  
  <pre><code>User_id  |  User_country  |  Datecreated (timestamp)
  1        |3               |  2012-09-09 09:37:03
  2        |7               |  2012-10-09 16:22:36
  </code></pre>
  
  <p>Now i want a result in a way like this (from starting month to current month)</p>
  
  <pre><code>September | September &amp; October
  1 record  | 2 records
  </code></pre>
  
  <p>I try this, but the result is opposite, from current month to start of month i.e (october, october+september, october+september+august). Also i wrote seperate query for each </p>
  
  <p>My Queries for Current Month is</p>
  
  <pre><code>SELECT * FROM tbl_track 
    WHERE YEAR(`date_created`) = YEAR(CURRENT_DATE) 
    AND MONTH(`date_created`) = MONTH(CURRENT_DATE)
  </code></pre>
  
  <p>My Query for Current &amp; Previous month is</p>
  
  <pre><code>SELECT * as count FROM tbl_track 
   WHERE YEAR(`date_created`) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH)
   AND MONTH(`date_created`) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH)
  </code></pre>