Getting an:
Fatal error: Call to undefined method UsersController::select() application/models/User.php on line 27
It looks like the UsersController is not sending the select function to the db.class.php which I have inside a library folder.
The db.class.php is being loaded however not in this case.
code inside the UserController.php class is:
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" => $username,
    );
    $result = $this->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();
}
}
Select Function inside db.class.php
public function select($table, $where="", $bind="", $fields="*") {
    $sql = "SELECT " . $fields . " FROM " . $table;
    if(!empty($where))
        $sql .= " WHERE " . $where;
    $sql .= ";";
    return $this->run($sql, $bind);
}
I think it maybe the reference to $this->select() but I'm learning.