hi guys...i have these lines in my delete checkbox script. i managed to delete the data thats been check with the checkbox, but im having problem trying to delete the images that comes with it. with the existing script below, i managed only to delete the first item in the array... is there anyway I could loop the unlink to delete not only the first item in the array but the whole results of the array for the image to delete?
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "formSubmit")) {
$frm_chk_delete = $_REQUEST['checkbox'];
$list_of_ids = implode(",", $frm_chk_delete);
mysql_select_db($database_connAvtar, $connAvtar);
$query_rsImages = sprintf("SELECT thumbF, image1F, image2F, image3F, image4F FROM property WHERE id IN ($list_of_ids)");
$rsImages = mysql_query($query_rsImages, $connAvtar) or die(mysql_error());
$row_rsImages = mysql_fetch_assoc($rsImages);
$totalRows_rsImages = mysql_num_rows($rsImages);
$del[0] = $row_rsImages['thumbF'];
$del[1] = $row_rsImages['image1F'];
$del[2] = $row_rsImages['image2F'];
$del[3] = $row_rsImages['image3F'];
$del[4] = $row_rsImages['image4F'];
for($h=0;$h<5;$h++) {
if($del[$h]) {
unlink('../content/properties/' . $del[$h]);
}
}
$result = mysql_query("DELETE FROM property WHERE id IN ($list_of_ids)");
if($result){
echo "<meta http-equiv=\"refresh\" content=\"0;URL=properties.php\">";
}
}
hope somebody could assist me with it... thank you in advance!