When I try to run a simple function it shows me:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Site::$model_users
Filename: controllers/site.php
Line Number: 14
Fatal error: Call to a member function get_news() on a non-object in /hermes/bosoraweb130/b418/ipg.blazewarcom/ci/application/controllers/site.php on line 14
The functions:
model_users.php located in models folder:
public function get_news()
{
$query = $this->db->query("SELECT * FROM tblnews ORDER BY newId DESC LIMIT 3");
return $query;
}
site.php located in controllers folder:
public function home_news() {
$query = $this->model_users->get_news(); //This line causes the problem
...
...
}