CodeIgniter: Can't load database from within a model
- by thedp
Hello,
I've written a new model for my CodeIgniter framework.
I'm trying to load the database from within the constructor function, but I'm getting the following error:
Severity: Notice
Message: Undefined property: userdb::$load
Filename: models/userdb.php
Line Number: 7
Fatal error: Call to a member function database() on a non-object in
/var/www/abc/system/application/models/userdb.php on line 7
Here is my model:
<?php
class userdb extends Model {
function __construct() {
$this->load->database();
}
?>
What am I doing wrong here?
Thank you.