【发布时间】:2015-09-25 14:56:35
【问题描述】:
当我运行这段代码时,它工作正常
echo $str = $this->db->last_query();
这一行之后
if($selectRecords->num_rows()>0){
//some action
}
我正在解决这个错误
<br />
<b>Fatal error</b>: Call to undefined method CI_DB_mysql_driver::num_rows() in <b>/vagrant/application/controllers/applicationtable.php</b> on line <b>1240</b><br />
这是我的代码
<?php
public function xyz(){
$selectRecords=$this->db->select(" (SELECT name FROM $this->reportTable WHERE id=$this->reportType) AS `$this->reportLabel`,
SUM(rashi_given) AS `total` ,
SUM(rashi_accepted) AS atotal");
$selectRecords->join('type', 'applicants.type=type.id', 'left');
$selectRecords->group_by($this->reportType);
$selectRecords->get('applicants');
echo $str = $this->db->last_query();
if($selectRecords->num_rows()>0){
}
}
?>
有什么问题请帮忙
【问题讨论】:
标签: php codeigniter