Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Call to a member function get() on a non-object in
#1

[eluser]Jason McCallister[/eluser]
I am running through the video tutorial for CI and ran into this problem:

Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined property: Blog::$db

Filename: controllers/blog.php

Line Number: 14


Fatal error: Call to a member function get() on a non-object in /Applications/xampp/xamppfiles/htdocs/xampp/codeignitor/system/application/controllers/blog.php on line 14

Here is the blog.php controller; for some reason it hates get. Any ideas?

Code:
<?php

class Blog extends Controller {
    
    function Blog()
        {
            parent::Controller();
    
        }
    function index()
        {
            $data['title'] = "My First CodeIgniter Site";
            $data['heading'] = "Heading Goes Here";
            $data['entry'] = $this->db->get('entries');
            
            $this->load->view('blog_view', $data);
        }
    
}

?>


Messages In This Thread
Fatal error: Call to a member function get() on a non-object in - by El Forum - 07-31-2008, 06:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB