We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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



3.3k
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.phalcon.io/help/markdown ) for how to properly format code.

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