After reading the article I tried to delete the image from the directory:
$getfile = mysql_query("SELECT I.filename FROM timages I LEFT JOIN tholidaysimages AS TH ON TH.imageid=I.id WHERE hotelid=".$hotelid); while ($row = mysql_fetch_object($getfile)) { $file = $row->pic; unlink("../../static/uploads/holidays/$file"); At the entrance of the function I only have $ hotelid. What am I doing wrong?
filename, why do you refer to it below aspic? AndLEFTinJOINabsolutely not appropriate, you do not need to receive records from pictures, regardless of whether there are entries for them in the second table or not - Mike