Welcome Guest, Not a member yet? Register   Sign In

The problem is fixed!
The answer is: I didn't know that you have to change the autoload file.
The autoload libaries array. You need to put in the database there. If you use the database.

Hey, i'm new with framework. And this one looks very nice.
Now i was trying. With tutorials and the user guide. But i wasn't getting far.

If i connect to my Database by a model. And then load the model in a controller. So i can view my database content. I get errors.

My model code: (filename: web.php)
class Web extends CI_model {

function __construct() {


function get_web_title() {

  $q = $this->db->get('settings');
  return $q->result();


My controller code: (filename: site.php)
class Site extends CI_Controller {

function __construct() {

public function index() {
  $data['query'] = $this->Web->get_web_title();
  $this->load->view('header_view', $data);


The errors i get:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Site::$db

Filename: core/Model.php

Line Number: 51
Fatal error: Call to a member function get() on a non-object in C:\wamp\www\win-oortjes\application\models\web.php on line 12

Maybe it is a simple mistake, but i can't find it. I over look it al a couple off times. But can't find the exact problem

Thank you!

Theme © iAndrew 2016 - Forum software by © MyBB