Welcome Guest, Not a member yet? Register   Sign In
HELP please :)
#1

[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);
    }
}

?>


Messages In This Thread
HELP please :) - by El Forum - 01-06-2010, 11:55 PM
HELP please :) - by El Forum - 01-07-2010, 12:08 AM
HELP please :) - by El Forum - 01-07-2010, 12:16 AM
HELP please :) - by El Forum - 01-07-2010, 12:36 AM
HELP please :) - by El Forum - 01-07-2010, 01:00 AM
HELP please :) - by El Forum - 01-07-2010, 01:20 AM
HELP please :) - by El Forum - 01-07-2010, 02:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB