title: Count clicks in date range with SQL (PHP)
body: <p>I want to count all clicks based on daily level from a date range.</p>
  
  <p>Let's say I want to count all clicks between "2013-05-01" - "2013-05-30" and want the following result to be something like this:</p>
  
  <pre><code>date            clicks
  2013-05-01      50
  2013-05-02      60
  2013-05-03      65
  2013-05-04      0
  etc...
  </code></pre>
  
  <p>At the moment I've the following SQL call</p>
  
  <pre><code>SELECT count(date) as clicks, date FROM views WHERE uid = $id group by date ORDER BY date DESC
  </code></pre>
  
  <p>This is working fine, the only problem is, that I don't get all the days in the date range, but only the days where there is clicks. I should be able to get all days, also the days where there is 0 clicks.</p>
  
  <p>Hope someone can help</p>