title: Get query from mysql database group by day
body: <p>I have a table like this:  </p>
  
  <pre><code>id           view_time               view_cost               view_ip       ect
  1           2012-05-03 00:00:00     10                      46.196.25.2   ----
  2           2012-05-03 00:00:00     30                      46.196.25.2   ----
  3           2012-05-03 00:00:00     20                      46.196.25.2   ----
  4           2012-05-04 00:00:00     10                      46.196.25.2   ----
  5           2012-05-04 00:00:00     80                      46.196.25.2   ----
  6           2012-05-05 00:00:00     40                      46.196.25.2   ----
  7           2012-05-05 00:00:00     50                      46.196.25.2   ----
  8           2012-05-05 00:00:00     10                      46.196.25.2   ----
  9           2012-05-05 00:00:00     10                      46.196.25.2   ----
  10          2012-05-05 00:00:00     20                      46.196.25.2   ----
  11          2012-05-05 00:00:00     10                      46.196.25.2   ----
  </code></pre>
  
  <p>And my result must like this:  </p>
  
  <pre><code>Day          Views          Cost
  2012-05-03   3              60
  2012-05-04   2              90
  2012-05-05   6              140
  </code></pre>
  
  <p>And i looking for Mysql query and php code for get this result </p>