[eluser]pickupman[/eluser]
Make sure you have loaded the database class. In /application/config/autoload.php check if you have autoloaded the database library. If it is not add it to the file at around line 42. Also make sure you have configured your database connection in /application/config/database.php.
If you would rather load the database libary in your controller you may do by using:
Code:
class Blog extends Controller{
function Blog(){
parent::Controller();
$this->load->library('database'); //load database class
}
}