corillo181 Posted February 15, 2007 Share Posted February 15, 2007 some one in this forum help me on how to delete multiple date from my sql, it worked fine, but now i'm trying to use it with images and i need to delete the pictures from the folder also, i had an idea on how make this wokr, but it was of no use can any one help me out? this is the current code with out deleting from the folder, if it was 1 at a time is easy but various is not as easy. if(isset($_POST['Submit'])){ $ids = implode(',',$_POST['delete']); $qry = "DELETE FROM `tra_userpic` WHERE `userpic_id` IN(" . $ids . ")"; $qry = mysql_query($qry); if($qry){ $thumb= mysql_query("DELETE FROM `tra_userpic_thumb` WHERE `userpic_id` IN(" . $ids . ")"); } } Link to comment https://forums.phpfreaks.com/topic/38675-delet-multiple-fields-and-in-folder/ Share on other sites More sharing options...
corillo181 Posted February 15, 2007 Author Share Posted February 15, 2007 ok i gave up on my first task, but i need this done so i changed it to a different way now i dont know what i still cant delete it from the file.. any one see the problem? if(isset($_POST['Submit'])){ $name=$_POST['delete']; $qry = mysql_query("DELETE FROM tra_userpic WHERE picname='$name'")or die(mysql_error()); unlink('userpic/'.$name); if($qry){ $thumb= mysql_query("DELETE FROM tra_userpic_thumb WHERE name='$name'")or die(mysql_error()); $ad='userpic/tn'.$name; unlink($ad); } } Link to comment https://forums.phpfreaks.com/topic/38675-delet-multiple-fields-and-in-folder/#findComment-185788 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.