The error below materializes when calling some PHP site URLs directly (e.g. /ajax/questions/process-delete-question):
Fatal error: Call to a member function num_rows() on a non-object in
/var/www/html/noodle/noodle_ci/application/models/config_model.php on line 76
It's this code basically in /var/www/html/noodle/noodle_ci/application/models/config_model.php:
66 $res = $this->db->query('
67 SELECT
68 id,
69 config_key,
70 config_value
71 FROM
72 '.$this->table.' sc
73 WHERE sc.site_id = '.$this->db->escape($site_id)
74 );
75
76 if($res->num_rows() > 0)
77 $configs = $res->result("array");
My guess is $res is "null". How can I rectify this?