我正在尝试执行如下查询:select*from bookdetails where quantity>0 ORDER BY created_date DESC
但我收到类似Call to a member function num_rows() on a non-object in...
请帮我解决这个问题的错误。
public function get_all_book_list_ByCreatedDateDSC($limit, $start,$sortsesval)
{
$this->load->database();
$this->db->limit($limit, $start);
$query=$this->db->join('coverdetails', 'coverdetails.cover_id = bookdetails.cover_id')->order_by('created_date', 'DESC')->get_where('bookdetails',array('quantity >', '0'));
if ($query->num_rows() > 0)
{
foreach ($query->result() as $row)
{
$data[] = $row;
}
return $data;
}
return false;
}