Forum Moderators: coopster
this is a really silly problem, but its driving me mad. the short of it is i have a database which holds the filename of images on my server, as well as press releases. when the admin deletes a post, i want the releven pic's deleted from the server, and its giving me hell. i dont think its beacuse i am on a windows box cause i can specify a specific file for it to delete fine, its just when it has to pull the name from a database. any ideas?
// generate and execute query
$pic=$_get['pic'];
$id= $_GET['id'];
$query = "DELETE FROM news WHERE id = '$id'";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
$file="../keith-robinson_news/images/".$pic;
unlink ($file);