Featured Replies in this Discussion

$sql doesn't exist. $s returns boolean (success/failure). What is the point of line 9? If all the images are in the same folder, you can dispense with the '$t' query. Anyway, $t is just a resource - not a string (file location). You need to call ... to get the path.

pass your file name in a varialbe like
$t = mysql_query("SELECT filename from image_gallery WHERE id IN ($p)");
$url=mysql_fetch_array($t);
$image=$url['filename']; //what field you use in db type in the url index
then do
unlink($image);
this will delete the file from directory....