Use $this->load->database();
$this->load->database();
Instead of $this->load->library('database');
$this->load->library('database');