Fatal error: Call to undefined method CI_DB_mysqli_driver::result()

Fatal error: Call to undefined method CI_DB_mysqli_driver::result()

我尝试了很多方法来连接两个表,但都显示错误。显示致命 error.i 我是 CodeIgniter 的初学者。

在模型上我的功能是这样的

$quer=$this->db->select('*')->from('assign_tble')
->join('course_details','assign_tble.ccode=course_details.ccode','LEFT')
->where('assign_tble.scode',$userID);
return $quer->result(); 

而 运行 它显示致命错误

Fatal error: Call to undefined method CI_DB_mysqli_driver::result() in C:\wamp\www\keitauniv\application\models\AllCourses_m.php on line 41 Message: Call to undefined method CI_DB_mysqli_driver::result()

这是 运行 时显示的错误。

$quer=$this->db
->select('*')
->from('assign_tble')
->join('course_details','assign_tble.ccode=course_details.ccode','LEFT')
->where('assign_tble.scode',$userID)

->get(); //Getting the results ready...


return $quer->result(); 

---.---

你必须get()使用它们之前的结果

您可以找到 CI Query Builder 的文档 Here

$this->db->select('*')
->from('assign_tble')
->join('course_details','assign_tble.ccode=course_details.ccode','LEFT')
->where('assign_tble.scode',$userID);

 $query = $this->db->get();         
 return $query->result();