prepare("SELECT special FROM users WHERE id=:id"); $stmt->bindParam(":id", $person); $stmt->execute(); $res = $stmt->fetch(PDO::FETCH_ASSOC); if($res["special"]=="banned"){ $person = $_GET["user"]; $stmt = $conn->prepare("UPDATE users SET special=null, ban_reason=null WHERE id=:id"); $stmt->bindParam(":id", $person); $stmt->execute(); if($stmt){ $person = getUserInfo($person)->name; msg("$person has been unbanned"); header("Location: /admin/portal/unbanUser.php"); }else{ msg("Error unbanning $person"); reportError("Error unbanning $person in /admin/portal/manage.php"); header("Location: /admin/portal/unbanUser.php"); } }else{ msg("$person was never banned"); header("Location: /admin/portal/unbanUser.php"); } } ?>

UNBAN USER

prepare("SELECT * FROM users WHERE special='banned'"); $stmt->execute(); $row = $stmt->fetchAll(); if(sizeof($row)==0){ echo "No banned users :D"; } foreach($row as $person){ echo "".$person["name"]."
"; } ?>