well i did it this way and it works in case if someone later need the answer.
delete.php
$id = $_GET["id"]; //ID OF THE ITEM FROM THE OTHER FILE $select=mysql_query("select img from $table where id='$id'"); $image=mysql_fetch_array($select); $img = $image['img']; unlink("C:/wamp/www/ifinal/photos/$img"); $result=mysql_query("delete from $table where id='$id'");
a href that sends the id to the delete.php
<a href="inc/delete.php?id=<?php echo $i_id;?>"><img src="inc/delete.png" style="height:15px;width:15px;"></img></a>