2017-04-15 87 views
1

我嘗試了很多方法來連接兩個表,但顯示錯誤。顯示致命的錯誤。我是CodeIgniter的初學者。致命錯誤:調用未定義的方法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); 
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()

這是顯示運行時錯誤,而。

+0

加上'$ QUER = ... - > get();' – splash58

+0

[PHP Codeigniter錯誤:調用未定義的方法ci \ _db \ _mysql \ _driver :: result()](http://stackoverflow.com/queue stions/8224655/php-codeigniter-error-call-to-undefined-method-ci-db-mysql-driverresult) –

+0

@RïshïKêshKümar你是對的 –

回答

0
$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(); 
+0

感謝您的大力支持 –

+0

:)任何時間.... –

1
$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

+0

非常感謝你先生。奧馬爾 –

+0

好............. –

相關問題