我正在尝试获得类似的结果select * from bookdetails where display_id = $id with few foreign key join condition
我已经编写了以下查询,但它显示的错误如下:
致命错误:在 C:\xampp\htdocs\project 中第 432 行的非对象上调用成员函数 num_rows(),即 *if ($query->num_rows() > 0)...
模型.php
public function get_all_book_list_atHomeTop($id, $limit, $start)
{
$this->load->database();
$this->db->limit($limit, $start);
$this->db->get_where('bookdetails', array('display_id' => $id));
//-------join condition ------------------
//------------Ends here Join condition
$query = $this->db->get();
if ($query->num_rows() > 0)
{
foreach ($query->result() as $row)
{
$data[] = $row;
}
return $data;
}
return false;
}