title: SQL sum of columns in Codeigniter
body: <p>I have a an SQL table as follows: </p>
  
  <pre><code> &gt;--------------------------  
  &gt;|ID | AMOUNT | PRODUC_ID |  
  &gt;--------------------------  
  &gt;|1  | 100    | 5   
  &gt;|2  | 100    | 5  
  &gt;|3  | 100    | 5  
  &gt;|4  | 100    | 10  
  &gt;|5  | 100    | 10  
  &gt;|6  | 100    | 10 
  
  &gt;|6  | 100    | 10
  </code></pre>
  
  <p>Im using codeigniter, Im expecting to get the SUM OF AMOUTS according to the PRODUCT_ID dynamically. the required output is:</p>
  
  <pre><code>&gt;sum of prodcut_id 5 = 300
  
  &gt;sum of prodcut_id 10 = 400
  </code></pre>