[eluser]webnology[/eluser]
Hi all,
this is my first project, so I might start to ask some silly questions. Here I go.
I try to execute a function from my model, getNumberOfArtists.
My model is like this:
Code:
class Artists extends Model {
function Artists() {
parent::Model();
}
}
//Get nr of artists in atg
function getNumberOfArtists() {
$Q = $this->db->query('SELECT * FROM atg_bands');
$nr_artists = $Q->num_rows();
return $nr_artists;
}
The model is called artists.php
My COntroller looks like this:
Code:
class Home extends Controller {
//Constructor
function Home() {
//Controller is our parent Class
parent::Controller();
//Load helpers
$this->load->helper('url');
$this->load->helper('form');
}
function index() {
//Load artists model
$this->load->model('artists');
$data['nr_artists'] = $this->artists->getNumberOfArtists();
}
}
The eroor I get is: Fatal error: Call to undefined method Artists::getNumberOfArtists() in /var/www/..../application/controllers/home.php on line 27
Could anyone help me please?
Kind regards,
M