[eluser]dadamssg[/eluser]
I'm trying to learn by going through the tutorial found on the site. Im on the second tutorial but i don't think im connecting to my database.
$data['query'] = $this->db->get('test');
this line throws an error. i set up a table with multiple rows and called it 'test'
this is the error im getting
Fatal error: Call to a member function get() on a non-object in /controllers/blog.php on line 16
*the autoload script in the tutorial wasn't the same one i got when i downloaded it. It talked about using the autoload to load the database connection. Well i didn't find that 'core' variable in the autoload file. I added it to mine though.
below is my whole blog.php file
Code:
<?php
class Blog extends Controller {
function Blog()
{
parent::Controller();
}
function index()
{
$data['title'] = "My Blog Title";
$data['heading'] = "My Blog Heading";
$data['query'] = $this->db->get('test');
$this->load->view('blog_view', $data);
}
}
?>