[eluser]Piero[/eluser]
Hey,
Following the second video tutorial, I've got this simple controller:
Code:
<?php
class Artist extends Controller {
function Artist(){
parent::Controller();
// $this->load->scaffolding('artist');
$this->load->helper('url');
$this->load->helper('form');
}
function index() {
$data['title'] = "Artist Title" ;
$data['heading'] = "Artist Heading" ;
$data['an_array'] = array("item1","item2","item3") ;
$data['query'] = $this->db->get('artist') ;
$this->load->view('artist/index', $data);
}
}
?>
And when I call the page I've go this error:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Artist::$db
Filename: controllers/artist.php
Line Number: 22
Fatal error: Call to a member function get() on a non-object in /var/www/marie/system/application/controllers/artist.php on line 22
Since my class extends the Controller class, how come that $db is not recognized?
I don't get it...