title: db class function not recognised
body: <p>Getting an: </p>
  
  <blockquote>
    <p>Fatal error: Call to undefined method UsersController::select() application/models/User.php on line 27</p>
  </blockquote>
  
  <p>It looks like the UsersController is not sending the select function to the db.class.php which I have inside a library folder.</p>
  
  <p>The db.class.php is being loaded however not in this case.</p>
  
  <p>code inside the UserController.php class is:</p>
  
  <pre><code>class User extends Model
  {        
  
  /**
   * Login method
   *
   * @todo: update last_login_time
   * @todo: add hashing
   */
  public function user_login() {
  
      $username = $_POST['data']['User']['username'];
      $password = $_POST['data']['User']['password'];
  
  
      $bind = array(
          ":username" =&gt; $username,
      );
      $result = $this-&gt;select("users", "username = :username", $bind);
  
      //Check the password returned from the db against the password entered
      if (Bcrypt::checkPassword($password, $result[0]['password']) == true) {
          Session::init();
  
          Session::set('user_logged_in', true);
          Session::set('user_id', $result[0]['id']);
          Session::set('user_name', $result[0]['username']);
          Session::set('user_permission', $result[0]['permission']);
          Session::set('user_role', $result[0]['role']);
  
          return true;
      } else {
          return false;
      }
  }
  
  
  /**
   * Log out process, deletes cookie, deletes session
   *
   * @todo implement rememberme cookie
   */
  public function logout()
  {
      // set the remember-me-cookie to ten years ago (3600sec * 365 days * 10).
      // that's obviously the best practice to kill a cookie via php
      // @see http://stackoverflow.com/a/686166/1114320
      //setcookie('rememberme', false, time() - (3600 * 3650), '/', COOKIE_DOMAIN);
  
      Session::init();
      // delete the session
      Session::destroy();
  }
  
  }
  </code></pre>
  
  <p>Select Function inside db.class.php</p>
  
  <pre><code>public function select($table, $where="", $bind="", $fields="*") {
      $sql = "SELECT " . $fields . " FROM " . $table;
      if(!empty($where))
          $sql .= " WHERE " . $where;
      $sql .= ";";
      return $this-&gt;run($sql, $bind);
  }
  </code></pre>
  
  <p>I think it maybe the reference to $this->select() but I'm learning.</p>