title: Generating daily statistics with MySQL
body: <p>I need to generate daily sales statistics with my database called "orders" , one of its fields is called "date" (DATETIME).</p>
  
  <p>My query is quite simple:</p>
  
  <pre><code>SELECT DAY(date) , COUNT(id_order)
  FROM z_view_order_list
  WHERE WEEK(date) = WEEK(NOW())
  GROUP BY DAY(date)
  LIMIT 7
  </code></pre>
  
  <p>The problem is that if for example there was no sales yesterday, yesterday will not be
  shown on result, but I need it to be shown with 0 value.</p>
  
  <p>Example of my actual result (Day/Sales):    27/3, 29/4, 30/2
  Example of result that I need (Day/Sales):  27/3, 28/0, 29/4, 30/2, 31/0</p>
  
  <p>Thanks in advance!</p>