Welcome Guest, Not a member yet? Register   Sign In
blog tutorial help
#1

[eluser]lawrencesilva[/eluser]
hello there,

im in the process of the 20minute blog tutorial

i have this line:

$data['query']= $this->db->get('entries');


and when i try to run the code this is the error that i get:

Fatal error: Call to a member function get() on a non-object in /var/www/CodeIgniter/system/application/controllers/blog.php


and

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Blog::$db

Filename: controllers/blog.php

Line Number: 28


thanks guys!
#2

[eluser]tonanbarbarian[/eluser]
you need to have active record enabled
in the config/database.php
Code:
$db['default']['active_r'] = TRUE;
#3

[eluser]lawrencesilva[/eluser]
thanks mate.

i think i found the problem

the autoupload of class is changed from the older version to the newest version

in which it uses $autoload['libraries'] = array('database');

to load the database class.

its working now, nonetheless thanks for the input and helping me out!




Theme © iAndrew 2016 - Forum software by © MyBB