prepare("SELECT * FROM sponsors"); //$query->bindParam(":idnum", "1"); $query->execute(); $notPaid = $query->fetchAll(); if (isset($_REQUEST["sponsorUpdate"])) { //Create Sessions $array = $_POST; foreach ($array as $key => $value) { $_SESSION[$key] = $value; } if(isset($_POST['paymentStatus'])) { $payment = $_POST['paymentStatus']; foreach($payment as $value) { $stmt = $conn->prepare("UPDATE sponsors SET paid=1 WHERE id = $value"); $stmt->execute(); } } else { $payment = $_POST['id']; foreach($payment as $value) { $stmt = $conn->prepare("UPDATE sponsors SET paid=0 WHERE id = $value"); $stmt->execute(); } } } ?>