**I am using xampp for this project.
Hi all having a small problem with an inventory I am building. When I delete an object from the database I want to delete the picture that I linked to it. I do this by giving the images the same ID as the product so when Im deleting the item I can just look up the image to delete via its id.
The problem is when I delete the object the image is not deleted. File_exists keeps returning false. Any help would be great.
if(isset($_GET["yesdelete"])){
$id_to_delete = $_GET["yesdelete"];
$sql = mysqli_query($link,"DELETE FROM products WHERE id = $id_to_delete") or die (mysqli_error());
$pictodelete=("../Images/$id_to_delete.jpg");
if(file_exists($pictodelete)){
unlink($pictodelete);
}
header("location: inventory_list.php");
exit();
}