EllisLab text mark
Advanced Search
     
image unlinking with imagename?
Posted: 03 April 2012 11:05 AM
Joined: 2012-03-20
69 posts

i have modified my code
now i have the image file name , can i simply unlink the image from its folder

[b]



 
function delete_images($id)
  
{
  
  
  $query
=$this->db->get_where('add_images', array('id'=>$id));
 
  foreach(
$query->result() as $row)
  
{
  $file_name 
$row->image//image is tbl field that holds the image name 
  
                
unlink( );
//what should i put inside the unlink function as i will delete     the   image from its folder    
    
return TRUE;
  
}
 $this
->db->delete('add_images', array('id'=>$id));  // add_images is my table name
  
  
}

[
/b] 
 
Posted: 03 April 2012 11:49 AM   [ # 1 ]   [ Rating: 0 ]
Joined: 2012-03-20
69 posts

i found the way:)
i just wrote the ......


          unlink(“images/”.$file_name); 
  unlink(“images/thumbs/”.$file_name);

Thanks to allll…....

 
Posted: 20 June 2012 12:19 AM   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2012-05-21
61 posts

thanks for your code, so i can learn.