From 5fc857449011f76ed7677aad40576790310d23e1 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 20 Apr 2025 16:06:19 +0500 Subject: feat: moved from SQLite to MySQL --- public/account/signout.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'public/account/signout.php') diff --git a/public/account/signout.php b/public/account/signout.php index dd1d0f9..66a0cac 100644 --- a/public/account/signout.php +++ b/public/account/signout.php @@ -1,5 +1,6 @@ prepare("UPDATE users SET secret_key = :secret_key WHERE id = :id"); -$stmt->bindValue(":id", $_SESSION["user_id"]); -$stmt->bindValue(":secret_key", generate_random_string(32)); -$stmt->execute(); +$stmt = $db->prepare("UPDATE users SET secret_key = ? WHERE id = ?"); +$stmt->execute([generate_random_string(32), $_SESSION["user_id"]]); session_unset(); session_destroy(); setcookie("secret_key", "", time() - 1000); -$db->close(); +$db = null; header("Location: /account"); \ No newline at end of file -- cgit v1.2.3