Tutorial problems: "Call to a member function on a non-object" |
[eluser]kyleb[/eluser]
Hey everyone, I'm new to CI and the MVC structure, but I am looking forward to developing with it! I am following the excellent tutorials here: http://codeigniter.com/tutorials/watch/blog/ And I'm having a bit of a problem loading any information from the database. I am using a pre-existing DB that I can connect to just fine (I have read-only access), scaffolding works, and I've done part one of the tutorial. My controller code looks like this: Code: <?php And my view code looks like this: Code: <h1><?=$heading?></h1> My problem is that when I attempt to view it at /index.php/visits, I get the following error: "Fatal error: Call to a member function on a non-object in ...../codeigniter/system/application/controllers/visits.php on line 16 Line 16, of course, is: $data['query'] = $this->db->get('VISIT'); I've quadruple checked it and Googled around - my code is identical to the screencast tutorial, yet it does not work at all. I am running some instance of PHP 4.x, though I don't think that matters. The table name is in all caps (yes, I know - I'm not the DBA, I don't control these things) and I assure you it exists, as: Code: SELECT * FROM VISIT LIMIT 20, 10 Thanks in advance! I know it's something small... |
Messages In This Thread |
Tutorial problems: "Call to a member function on a non-object" - by El Forum - 12-21-2009, 07:52 PM
Tutorial problems: "Call to a member function on a non-object" - by El Forum - 12-21-2009, 07:58 PM
Tutorial problems: "Call to a member function on a non-object" - by El Forum - 12-21-2009, 08:25 PM
Tutorial problems: "Call to a member function on a non-object" - by El Forum - 12-22-2009, 02:02 AM
Tutorial problems: "Call to a member function on a non-object" - by El Forum - 12-22-2009, 03:31 AM
|