prepare($confirmFetchUserQuery); $stmt->bindValue(":COD", $code); $stmt->execute(); $uid = $stmt->fetch(PDO::FETCH_COLUMN); if ($uid !== false) { $stmt = $db->prepare($confirmUserQuery); $stmt->bindValue(":UID", $uid); $stmt->execute(); array_push($_SESSION["message"], "Account confirmed, you can now log in!"); } else { array_push($_SESSION["error"], "Account could not be confirmed"); } DB::closeConnection($db); Headers::redirect("./login");