brem13 Posted March 10, 2009 Share Posted March 10, 2009 hey, i have a script where i want to delete pictures if the checkbox is selected, what it does is goes through and sees what checkbox is checked and deleted the field from my database aswell as the pic and thumbnail, it works, but after it deletes the pictures, its not there anymore and gives me an error when it finishes going through the folder looking for the pic even tho its already gone. i guess what i need help with is to have it stop looping after it deletes it here is the code ------------------------------- foreach($aPics as $PicKey => $picname) { if(array_key_exists($PicKey, $aComments)) { if (isset($delete[$PicKey])){ mysql_query("DELETE FROM $userlow WHERE picture='$picname'") or die(mysql_error()); unlink($picname); unlink("thumbs/".$picname); }//end iff }//end foreach here is the error -------------------------------- unlink(1234907747.jpg) [function.unlink]: No such file or directory in editgall.php on line 57 Link to comment https://forums.phpfreaks.com/topic/148845-mysql-loop-deleting-pictures/ Share on other sites More sharing options...
brem13 Posted March 10, 2009 Author Share Posted March 10, 2009 any ideas? Link to comment https://forums.phpfreaks.com/topic/148845-mysql-loop-deleting-pictures/#findComment-781604 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.