title: MySQL PHP group by day and total for each day
body: <p>I have a table in a mysql database with 3 columns: id, value and tstamp. My tstamp column is in TIMESTAMP format, ie: 2011-01-21 08:32:22</p>
  
  <p>What i hope to achieve is use PHP to display a break down of a total for each day. I cant think of a way to query the table, in pseudo code: select * from table group by day(part of tstamp) and add all numbers together from the value column for each day"</p>
  
  <p>Is this going to be possible?</p>
  
  <p>Thanks alot</p>
  
  <p>EDIT:</p>
  
  <p>I have this query in combo with the accepted answer's code:</p>
  
  <pre><code>$sql = "select date(tstamp), sum(".$column.") from mash group by date(tstamp)";
             $result = mysql_query($sql);
                  while($row = mysql_fetch_array($result)){
                        $strXML .= "&lt;set name='".date("G:i:s", strtotime($row["date"])).  "' value='".$row["sum"]."' color='AFD8F8' /&gt;";
                  }
  </code></pre>
  
  <p>How do i access the array values in $row correctly?</p>