undefined property - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: undefined property (/showthread.php?tid=53824) |
undefined property - El Forum - 08-10-2012 [eluser]cerberus478[/eluser] Hi I'm using codeigniter 2.1.2 and I'm busy doing a tutorial called codeigniter from scratch but I get an error saying Quote:A PHP Error was encountered and Quote:Fatal error: Call to a member function get() on a non-object in C:\wamp\www\ci\application\models\site_model.php on line 7 I have done everything like the tutorial said here is my controller Code: <?php This is my model Code: <?php This is my view Code: <html> undefined property - El Forum - 08-10-2012 [eluser]john_j[/eluser] Code: $q = $this->db->get('test'); Did you load 'test'? undefined property - El Forum - 08-10-2012 [eluser]cerberus478[/eluser] I'm sorry but what do you mean? undefined property - El Forum - 08-10-2012 [eluser]cerberus478[/eluser] Hi Thanks for your help I just realized that my database name was spelled differently then when I add it to the coding undefined property - El Forum - 08-10-2012 [eluser]Massaki[/eluser] [quote author="john_j" date="1344609985"] Code: $q = $this->db->get('test'); Did you load 'test'?[/quote] Code: $q = $this-db->get('test'); Code: $q = mysql_query("SELECT * FROM 'test'"); |