Thanks Kudose. I have been trying the following and it doesn't seem to be deleting the files. It is however deleting the records from the database as it should though. What am I doing wrong?
$sql2 = "Select * From photos Where listID = '".$id."' And listType = '".$cat."'";
$query = mysql_query($sql2);
$mypath = "".$cat."Listings/images";
while($remove = mysql_fetch_array($query)){
if($remove){
if(is_file($remove['fileName'])){
$deleteFile = "".$mypath."/".$remove['fileName']."";
unlink($deleteFile);
}
}
}
$sql3 = "Delete From photos Where listID = '".$id."' And listType = '".$cat."'";
$return = mysql_query($sql3);
Thanks