I upload the image to the server and save the path in the database. Now I want to delete this entry, as well as the image with this entry my code
$ id = $ _ GET ['id'];
$ select = mysql_query ("select image from table_name where question_id = '$ id'");
$ image = mysql_fetch_array ($ select);
@unlink ($ image ['image']);
$ result = mysql_query ("delete from table_name where question_id = '$ id'"); when I echo $ image ['image']; it will give me
http://www.example.com/folder/images/image_name.jpeg
The record is deleted successfully, but the image remains on the server.
souce code
source share