query($sql, "s", $username); return !empty($result); } function register_user(string $username, string $pass_hash) { $sql = "INSERT INTO users(user_name, user_pass, user_date) VALUES(?, ?, NOW());"; Database::get()->query($sql, "ss", $username, $pass_hash); } function change_password(User $user, string $pass_hash) { $sql = "UPDATE users SET user_pass = ? WHERE user_id = ?;"; Database::get()->query($sql, "si", $pass_hash, $user->id); }