I have a code that is supposed to delete image name from mysql table and the actual image from the server folder. The name deletes from database but the actual images are not deleting. Below is the code:
$sql_queryy = "SELECT imImage FROM gimage WHERE imID = '$chkbxk'";
$photoresultt = mysqli_query($connBiscup, $sql_queryy);
//$row_album_images = mysqli_fetch_assoc($photoresultt);
while ($row = mysqli_fetch_assoc($photoresultt)) {
unlink($target . $row[0]);
unlink($targett . $row[0]);
}
Any help please
this was the initial code.
for($i=0; $i<$N;$i++){
$chkbxk = $_POST['checkbox'][$i];
$sql_queryy = "SELECT imImage FROM gimage WHERE imID = '$chkbxk'";
$photoresultt = mysqli_query($connBiscup, $sql_queryy);
//$row_album_images = mysqli_fetch_all($photoresultt);
foreach ($row_album_images as $row)
{
unlink($target . $row[0]);
unlink($targett . $row[0]);
}
}
but because of the mysqlnd issue, i changed to a while loop.