慕虎7371278
我写了一个对我有用的代码,我在必要时解释了代码。看看它是否对你有帮助。$query = $this->db->select_sum('views')->get('videos')->result(); // gets the sum of data in views column.$totalViews = $query[0]->views; // the array returned contains the sum in key {0}echo $totalViews; // echo or return the output -- your logic