[eluser]Perkin5[/eluser]
The full error line is:
Fatal error: Call to undefined method Admin_model::get_code() in C:\wamp\www\historystoreNew\application\controllers\admin2012.php on line 119
line 119 is the third line of
fetchcode ie where the call to the model method occurs.
I've simplified
get_code in the model to this:
Code:
function get_code($pricecat){
print_r('got this far');die();
}
The controller method
fetchcode is:
Code:
function fetchcode(){
$pricecat = 'price_cat';
$results = $this->Admin_model->get_code($pricecat);
return $results;
}
price_cat is the name of the db table I'm trying to access.
The model is admin_model.php and I loaded it in the controller constructor like this:
Code:
$this->load->model('Admin_model');
and I know that's OK because other controller methods are accessing other model methods perfectly satisfactorily. I almost convinced myself that get_code was a reserved word in codeigniter but it isn't.
Another thing I've tried is to copy the
get_code method into the controller and access from there - modifying
fetchcode obviously - in which case it works fine
The syntax of
fetchcode is identical to other successful methods - I can't understand what's going wrong.