I am having a strange issue with mysql and codeigniter. I am getting the following error message:
Fatal error: Call to a member function result() on a non-object in
Controller:
class Event extends Client_Controller
{
function __construct()
{
parent::__construct();
$this->load->model('Event_Model', '', TRUE);
}
function pending()
{
$data['query'] = $this->Event_Model->get_events_list("pending");
$this->load->view('event/pending', $data);
}
}
Model:
class Event_Model extends Client_Model
{
function __construct()
{
parent::__construct();
}
function get_events_list($event_status = '')
{
$query = $this->db->query("SELECT * FROM tbl_events WHERE event_status= ? ORDER BY event_id DESC", array($event_status));
return $query->result();// Error is on this line
}
}
Autoload:
$autoload['libraries'] = array('database', 'session');
Any help is appreciated. I have some doubts that my mysql might time-out?