Everybody know how to delete the content like datas and images from database using php code. But nobody try to delete the image from folder also. The following code will explain how to delete the data from database and folder using unlink command in php and wordpress page.
$complete = $wpdb->get_results(“select * from babyitemdetails where itemid=’$slot'”);
foreach($complete as $value)
$sqla=”Delete from babyitemdetails where itemid=’$slot'”;