how to delete image folder

how to delete uploaded image from folder I try this code $propimages= "DELETE FROM property_images WHERE property_id =".$Id; $this->db->query($propimages); $filePath=DIR_PUBLIC.'img/propertie/'.$propimages['sessionid']; unlink($filePath);



1.6k
edited Sep '15
  1. $propimg = PropertyImages::findFirstByproperty_id($Id);
  2. $propimages= "DELETE FROM property_images WHERE property_id =".$Id;
  3. $this->db->query($propimages);
  4. $filePath=DIR_PUBLIC.'img/propertie/'.$propimg->sessionid;
  5. //echo "<pre>"; print_r($filePath); exit;
  6. unlink($filePath);

and i use this code also

__DIR__ . "/../path/backwords/to/folder"

Please read through this ( https://forum.phalconphp.com/help/markdown ) for how to properly format code.

Also, you haven't stated what your problem is.