I'm loading a model for my CodeIgniter based website, but it keeps giving an error:
"Fatal error: Call to a member function on a non-object in /nfs/c02/h05/mnt/30796/domains/planetchustar.com/html/arguit/system/application/controllers/home.php on line 8"
Here's the part of code its referencing:
function index()
{
$this->load->model('posts'); //error here
$result = $this->Posts->get_all_topics();
}
The model is called "Posts" and its filename is "posts.php".
EDIT: I found out one of my problems, which was that I wasn't loading to database before I tried to use its functions, so I fixed that, but now its saying:
A Database Error Occurred
Unable to connect to your database server using the provided settings.
But I'm certain the connection info I saved in the database.php file is accurate (got from the phpmyadin website).