when delete image from mysql database then also delete from folder it is possible
Yes. We need a little work on your end though for us to be able to help you out. Give it a try and come back with some source code so we can help you with any troubles your having.
You want to use:
unlink('path_to_the_image');
where we write this code after delete query
Where ever makes sense. Keep in mind we can’t see your code
code is
$del=$_REQUEST[‘del’];
$del = “DELETE FROM sliderimage where slid_id='”.$_REQUEST[‘del’].“'”;
$result = mysql_query($del);
image path folder name is upload
Before you do the MySQL delete you need to retrieve the image path and name and use that in the unlink.
$del=$_REQUEST['del'];
// Untested and I can not remember exactly what is required here but you should be able to work it out
$sel = "SELECT image path FROM sliderimage where slid_id='".$_REQUEST['del']."'";
$result = mysql_query($sel);
$row = mysql_fetch_array($result);
unlink($row['image path']);
$del = "DELETE FROM sliderimage where slid_id='".$_REQUEST['del']."'";
$result = mysql_query($del);
You should be using pdo or mysqli now.