如何回显SQL列表的SUM值

时间:2016-08-02 12:14:41

标签: php sql

我有这个SQL列表:

enter image description here

我有兴趣回复列表product_quantity的总量,所以它说301

enter image description here

//total
$this->tbl_inventory('product_quantity');
$data['total_quantity'] = count($this->global_model->get());

1 个答案:

答案 0 :(得分:0)

$this->tbl_inventory('product_quantity');
$data['total_quantity'] = sum($this->global_model->get());