dagon wrote:replace:
$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]);
}
}
with
foreach($row_rsImages as $del){
unlink('../content/properties/'.$del);
}
I would put in the full file path just to be sure
hi dagon...the current changes that you suggest still only deletes the first in the array $frm_chk_delete thats why I have this line :
$list_of_ids = implode(",", $frm_chk_delete);
to make a delete :
$result = mysql_query("DELETE FROM property WHERE id IN ($list_of_ids)");
but the problem is that only the first in $frm_chk_delete image could be deleted.
for example, what if I checked 3 checkboxes that has a value of 1,3 and 4. the data that has an ID 1, 3 and 4 were deleted in the database, but only the unlink of images of 1 is deleted. what I want is that after retrieving the images of 1, 3 and 4, it unlink it images, then delete it from the database.