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

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -