Fahmi Muhammad
Fahmi Muhammad

Reputation: 11

CodeIgniter A PHP Error was encountered fatal eror

I am a novice experiencing obstacles in doing the task A PHP Error was encountered

Severity: Notice

Message: Undefined property: CI_Loader::$db

Filename: views/templateadmin.php

Line Number: 311

Backtrace:

File: C:\xampp\htdocs\website\application\views\templateadmin.php Line: 311 Function: _error_handler

File: C:\xampp\htdocs\website\application\controllers\demo.php Line: 6 Function: view

File: C:\xampp\htdocs\website\index.php Line: 315 Function: require_once

and

Fatal error: Call to a member function get_where() on a non-object in C:\xampp\htdocs\website\application\views\templateadmin.php on line 311 A PHP Error was encountered

Severity: Error

Message: Call to a member function get_where() on a non-object

Filename: views/templateadmin.php

Line Number: 311

Backtrace:

Upvotes: 1

Views: 920

Answers (1)

BILAL MALIK
BILAL MALIK

Reputation: 141

write this in your controller

$this->load->database();

OR In your application>config>autoload.php file make sure you have databse written in your libraries

$autoload['libraries'] = array('database','session');

Upvotes: 1

Related Questions