I have made a project that's join query is working in local server, but not working on live server.
Live server shows an error as
Fatal error: Call to a member function result() on a non-object in /home/a3608717/public_html/CI/application/models/student_model.php on line 157
public function fetch_all_sbj(){
$query = $this->db->query("SELECT s.*,ct.*
from subject s INNER JOIN courseTerm ct
ON s.sbjId=ct.cTId");
return $query->result(); ///This is 157 line
}
If I write this query as
$query = $this->db->query("SELECT * from subject ");
or
$query = $this->db->query("SELECT * from courseTerm ");
The there is no error, But I need to join them. Similary, Problem also all of the query. Please help me.