title: Codeigniter: SUM of two columns
body: <p>I'm having problem getting the sum of the columns.
  it would be something like <code>SUM('billing_amount' - billing_philhealth)</code></p>
  
  <p>I tried the following code but didn't solve the problem...</p>
  
  <pre><code>&lt;?php
                         $this-&gt;db-&gt;where('billing_id', $data-&gt;billing_id);
                         $this-&gt;db-&gt;select_sum(('billing_amount') - ('billing_philhealth'));
                         $query3 = $this-&gt;db-&gt;get('billing_entry');
                         $x = 1;
                              foreach ($query3-&gt;result() as $tot)
                              {   
                                  echo '&lt;h3&gt;₱'.$tot-&gt;billing_amount.'&lt;/h3&gt;';
                                  echo '&lt;input type="hidden" name="total_amount" id="totAmt" value="'.$tot-&gt;billing_amount.'"&gt;';
                              } 
                  ?&gt;
  </code></pre>