[eluser]Avril[/eluser]
Hi!
I've decided to learn CodeIgniter to create a small but secure blog site for a client.
I'm a PHP & jQuery dev and I'm used to make custom CMS or edit existing once, but CI is very new to me so I could ask some bizar questions
.
So I've just started and I'm already running into a problem ^^.
Here's what I get as error message:
Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined property: Blog::$db
Filename: controllers/blog.php
Line Number: 7
and here's my code:
Code:
class Blog extends Controller{
function index(){
$q = $this->db->get('blog_posts');
if( $q->num_rows() > 0){
foreach( $q as $row ){
$array[] = $row;
}
return $array;
}
}
}
Not realy sure what I'm doing wrong here?