codeigniter - how to add up values in table column
问题 Trying to get the sum of the values entered within a column (af_am_msm) from my table (non_clinical_total_tests). I want to display that total within an html table. My error message is: A PHP Error was encountered - Severity: Notice - Message: Array to string conversion My MODEL: public function af_am_sum() { $this->db->select_sum('af_am_msm'); $query = $this->db->get('non_clinical_total_tests'); return $query->result(); } My CONTROLLER: public function index() { $data['af_am_total'] = $this-