php - Sum of data in multiple rows that echo with GROUP_CONCAT in CodeIgniter -


**enter image description here**

i have data set generated codeigniter using mysql. need total delivered qty in view page. used following code.

 <?php $delivered_qty_total += $row->quantity; endforeach; ?>  <?php endif; ?> 

but did not give accurate total of delivered qty. passing data group_concat separator "<br />".when using tbl_order_products.quantity instead of group_concat give me accurate total. need group_concat.

'group_concat(tbl_order_products.quantity separator "<br />" ) quantity ', 

add query:

sum(tbl_order_product.quantity) quantity_total 

see demo example of how see working you.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

Error while updating a record in APEX screen -

c++ - In an add-in in Excel, written in C(++), how does one get the name of the function which called into the addin? -