如何在 PHP 中删除多个图像。但单个产品删除工作正常。
if (isset($_REQUEST['delete_product'])) {
$ca_in_id = $_REQUEST['delete_product'];
$where = array("ca_in_id" => $ca_in_id);
$data = $this->select_where('catalog_inventory', $where);
//$res = $data->fetch_object();
$result = $this->delete_where('catalog_inventory', $where);
if ($result) {
// (file_exists($pic1)) {
// print_r($pic1);
// exit();
while ($row = mysqli_fetch_array($data)) {
$image = $row["upload_file"];
$pic1 = ("$image");
unlink('product_images/' . $pic1);
print_r($pic1);
}
exit();
//}
?>
<script>
alert("Delete Sucess");
window.location = "list-product";
</script>
<?php
} else {
?>
<script>
alert("Delete Fails");
window.location = "list-product";
</script>
<?php
}
}
多个图像删除显示此错误:-
如何解决这个问题?
ibeautiful