$this->gb->get->('entries') Problem |
[eluser]GamingFusion[/eluser]
I'm getting this error, I'm completing the CodeIgniter tutorials. I was wandering if i was doing something wrong. Quote:Fatal error: Call to a member function get() on a non-object in /home/.maybelle/gfadmin/site.gamingfusion.net/system/application/controllers/feed.php on line 14 to see the actual page with the error go to GamingFusion Site
[eluser]GamingFusion[/eluser]
heres my controller Code: 1| <?php
[eluser]tomcode[/eluser]
[quote author="GamingFusion" date="1240268294"]heres my controller Code: 14| $data['query'] = $this->db->get('entries'); You try to call the function get() of a object that is not declared on line 14, so I guess You have not loaded the database ($this->db)
[eluser]GamingFusion[/eluser]
well i am autoloading the database core library Code: $autoload['core'] = array('database'); is that code right and is there anything else i have to do yet, i have also setup the database file. Code: $db['default']['hostname'] = "hostname";
[eluser]Dam1an[/eluser]
I'm not sure what version you're using, but the database class is auto loaded under libraries (at least now)
[eluser]tomcode[/eluser]
Try Code: $autoload['libraries'] = array('database'); instead of 'core'. autoload core is deprecated. (that's why it is commented out, at least in recent CI versions). Do You really have Code: $db['default']['hostname'] = "hostname";
[eluser]GamingFusion[/eluser]
i'm using 1.7.1, if it has changed please tell, because i'm just following the videos like i said that were from 1.3 on the site. he should make new ones.
[eluser]GamingFusion[/eluser]
tomcode no i just changed them for the post, and the core libraries is not even in the config.php file anymore so i added it
[eluser]GamingFusion[/eluser]
ok i got that fixed thanks tomcode, but now i get some more errors with my view file. just to the link i gave in my first post. heres my view file code Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
[eluser]GamingFusion[/eluser]
i forgot heres my controller code Code: <?php |
Welcome Guest, Not a member yet? Register Sign In |