Jump to content

delet multiple fields and in folder.


corillo181

Recommended Posts

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

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);
}
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.