|
本帖最后由 Mapleleaf 于 2013-4-5 20:57 编辑
我想通过select_avg()函数,显示平均值,但是总出错,谢谢了!
代码如下:
public function avg_valuation($share_id){
$this->db->where('share_id =', $share_id);
$this->db->select_avg('valuation');
return $this->db->get('tupu_comment');
}
……
$avg_valuation = $this->comment_model->avg_valuation($share_id);
echo $avg_valuation ;
……
错误结果提示:
A PHP Error was encounteredSeverity: 4096
Message: Object of class CI_DB_mysql_driver could not be converted to string
Filename: controllers/share.php
Line Number: 110
|
|