title: CodeIgniter connection to database
body: <p>I decided end my cooperation with Doctrine 2.3 and now I would like to make connection to database using only CodeIgniter have you got idea where is problem with my code? </p>
  
  <p><strong>This Error I get:</strong></p>
  
  <pre><code>A PHP Error was encountered
  
  Severity: Notice
  
  Message: Undefined property: Hello::$db
  
  Filename: core/Model.php
  
  Line Number: 51
  </code></pre>
  
  <p><strong>Database.php</strong></p>
  
  <pre><code>$db['default']['hostname'] = 'localhost:8080';
  $db['default']['username'] = 'root';
  $db['default']['password'] = '';
  $db['default']['database'] = 'ci_doctrine';
  $db['default']['dbdriver'] = 'mysql';
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>&lt;?php
      // system/application/controllers/hello.php
  
      class Hello extends CI_Controller {
  
          public function __construct()
          {
               parent::__construct();
          }
         function world() {
              echo "Hello CodeIgniter!";
          }
  
          function user_test() {
  
              $this-&gt;load-&gt;model('user');
  
              $this-&gt;user-&gt;save_User('username','password','first_name','last_name');
  
         }
  }
  
  ?&gt;
  </code></pre>
  
  <p><strong>Model - table name in database "user"</strong></p>
  
  <pre><code>&lt;?php
      // system/application/models/user.php
  
      class User extends CI_Model {
  
              function __construct()
              {
                  // Call the Model constructor
                  parent::__construct();
              }
  
               function save_User($username,$password,$fName,$lName)  {
  
                  $this-&gt;username   = $username; 
                  $this-&gt;password = $password;
                  $this-&gt;first_name    = $fName;
                  $this-&gt;last_name    = $lName;
                  $this-&gt;db-&gt;insert('user', $this);
                }
  
      }
  ?&gt;
  </code></pre>