prepare("UPDATE events SET status = :status WHERE id = :id"); $stmt->bindParam(':status', $status); $stmt->bindParam(':id', $event_id, PDO::PARAM_INT); $stmt->execute(); } catch (PDOException $e) { // Handle database error header('Location: admin_dashboard.php?error=db_error'); exit(); } } } header('Location: admin_dashboard.php'); exit();