diff --git a/lib/account.php b/lib/account.php index eae4d91..7de55bd 100644 --- a/lib/account.php +++ b/lib/account.php @@ -312,16 +312,18 @@ function updateUserProfile(string $firstName, string $lastName, string $nickname $status = ["Status" => "Fail"]; if (isLoggedIn() && !empty($firstName) && !empty($lastName) && !empty($nickname) && !empty($minecraft_nickname)) { - $userID = $_SESSION["ID"]; $stmt = $mysqli->prepare("UPDATE Users SET FirstName = ?, LastName = ?, Nickname = ?, MinecraftNick = ? WHERE ID = ?"); /** @noinspection SpellCheckingInspection */ - $stmt->bind_param("ssssi", $firstName, $lastName, $nickname, $minecraft_nickname, $userID); + $stmt->bind_param("ssssi", $firstName, $lastName, $nickname, $minecraft_nickname, $_SESSION["ID"]); $stmt->execute(); if ($stmt->affected_rows > 0) { $status["Status"] = "Success"; } + else { + $status["Status"] = "Failing"; + } $stmt->close(); }