query("SELECT * FROM users"); // $result_set = $database->resultall(); // return $result_set; return self::find_by_sql('SELECT * FROM users'); } public static function find_by_id($id) { global $database; $database->query("SELECT id, username, password, first_name, last_name FROM users WHERE id = :id"); $database->bind(':id', $id); $found = $database->single(); return $found; } public static function find_by_sql($sql = "") { global $database; $stmt = $database->query($sql); $result = $stmt->execute(); return $result->resultall(); } } ?>