Undefined property: Blog::$db - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Undefined property: Blog::$db (/showthread.php?tid=13505) |
Undefined property: Blog::$db - El Forum - 11-25-2008 [eluser]featureBlend[/eluser] I am receiving PHP error: Undefined property: Blog::$db - while connecting to my database. Here is the code i used in the controller blog.php: Code: <?php and here's the code for the the View file: blog_view.php Code: <html> I am not using shorthand codes for php since i am on a local server and dont know how to enable it...Yes i have setup all the files for the database Any thoughts? I know im a newbie, but the minute i figure out how it works, the rest will become trivial. Undefined property: Blog::$db - El Forum - 11-25-2008 [eluser]pistolPete[/eluser] You need to load the database class. Have a look at the documentation: http://ellislab.com/codeigniter/user-guide/database/connecting.html Either you load it manually using Code: $this->load->database(); Undefined property: Blog::$db - El Forum - 11-25-2008 [eluser]featureBlend[/eluser] Thank you PistolPete, appreciated.... BTW if you all want to your server to accept PHP shorthand codes please change that in your php.ini file. Undefined property: Blog::$db - El Forum - 04-17-2010 [eluser]sandeep nami[/eluser] @pistol pete thanq very much |