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:
You're forgetting to call the parent constructor first. Something like:
<?php
class userdb extends Model {
function __construct() {
parent::Model();
$this->load->database();
}
?>
I'm not sure if it would cause a problem or not, but Model names are supposed to have the first letter capitalized. http://ellislab.com/codeigniter/user-guide/general/models.html Jens is also correct that you need to call the parent constructor as well.