Delete File From Uploaded Folder


        <?php
        include_once 'dbconnect.php' ;

        $id=$_GET['/'];
        $sql="select * from tbl_user where id='{$id}'";
        $result_set=mysqli_query($con,$sql);
        $count=mysqli_affected_rows($con);
        if($count>0){

            $data=mysqli_fetch_assoc($result_set);
        
            $file=$data['file'];
            $file_path = __DIR__."/upload/vv/";
            $delete = unlink($file_path.$file);
            if($delete)
            {
        $sql = "delete from tbl_user where id ='{$id}'";
        $reslut_set = mysqli_query($con,$sql);
        $count = mysqli_affected_rows($con);
        if($count){
            header("location:show.php");        
        }else{
        ?>
        <script>
        window.alert("Not Deleted");
        window.location.href="show.php";
        </script>
        <?php
        }
            }

        
        }else{

            echo "No Record Found";
        }

        ?>


Delete File From Uploaded Folder