connect_error) { die("Connection failed: " . $link->connect_error); } foreach ($productIDs as $id) { $query = "DELETE FROM `" . SHOP_ID . "_product` WHERE `id` = ?"; $stmt = $link->prepare($query); $stmt->bind_param("i", $id); $stmt->execute(); header("Location: ./view-product"); $stmt->close(); } $link->close(); ?>