title: how to get today total data sum form mysql database?
body: <p>I need to get today due sale. total sale row 'total' ,total paid row 'paid'.
  i need get today total due.</p>
  
  <pre><code>$sql = "SELECT id, SUM(total) AS total, SUM(paid) AS paid FROM sma_sales WHERE DATE(`timestamp`) = CURDATE()";
  $result = $conn-&gt;query($sql);
  if ($result-&gt;num_rows &gt; 0) {
      // output data of each row
      while($row = $result-&gt;fetch_assoc())
      {
          echo $sum = $row['total'] - $sum = $row['paid'];
      }
  } else {
      echo "0.00 results";
  }
  </code></pre>
  
  <p>I got result 0.00 I need view today total "due sale" amount result.
  <a href="http://i.stack.imgur.com/uDpDe.png" rel="nofollow">database table screen shot</a></p>
  
  <p>please help.</p>