title: Summing the total of the selected column in PHP, is my code right?
body: <p>I am creating a code for this total sales of "Price" column, am i doing it right???   </p>
  
  <pre><code>public function gettotalsales()
  {
          $stmt = $this-&gt;conn-&gt;prepare("Select SUM(Price) From tbl_orderlist where Price != '' ");
          $stmt-&gt;execute();
          return $stmt;
  }
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/1Z0Ba.png" rel="nofollow">Database img</a></p>