CodeIgniter Forums
Issue with video tutorial... - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Issue with video tutorial... (/thread-10788.html)



Issue with video tutorial... - El Forum - 08-12-2008

[eluser]Adam Mills[/eluser]
Hi all, just started using this today, decided to go through the tutorial. I'm on the second video tutorial and am experiencing an error. Tried doing a forum search to see if it was common, but didn't see anything come up. So here is my issue, hopefully someone can help.

Everything has worked fine up to this point ... I insert this line of code:

Code:
$data['query'] = $this->db->get('blog');

and I get this error:

Quote:Fatal error: Call to a member function on a non-object in [url info] on line 13

thanks in advance for any help...


Issue with video tutorial... - El Forum - 08-12-2008

[eluser]SneakyDave[/eluser]
Have you loaded the database library in autoload.php? Not sure if that would be it, but it could be. Is it the first database call?

http://ellislab.com/codeigniter/user-guide/database/examples.html


Issue with video tutorial... - El Forum - 08-12-2008

[eluser]Adam Mills[/eluser]
I put the database load in my autoload config file:
Code:
$autoload['core'] = array("database");

:/

And the scaffolding worked fine, could insert data just fine ... so ... I assume I have all the database stuff set up correctly.

It is indeed the first DB call.


Issue with video tutorial... - El Forum - 08-12-2008

[eluser]Adam Mills[/eluser]
wow, ok ... perhaps I should read the comment in the file ... core is no longer right ... supposed to use the libraries ... got it now ... thanks Smile


Issue with video tutorial... - El Forum - 08-12-2008

[eluser]Tom Glover[/eluser]
Have you set the database setting in the database config file?