title: Delete with unlink() from database with uploaded location in php
body: <p>i have an error when trying to unlink my files from local disk :</p>
  
  <pre><code>if(isset($_POST['delete'])){
      $name = $_POST['deleteEntryName'];
      $query = "select name,image from image where name =  '".$name."' ";
      $result = $db-&gt;query($query);
  
      if(mysqli_num_rows($result)&gt;0)
          {
              $delQuery = "delete from image where name = '".$name."' ";
              $delResult = $db-&gt;query($delQuery);
              $delPath = $query['image'];
              unlink($delPath);
              alert("File successfully deleted");
              redirect("newEntry.php");
          }
          else
          {
              alert("File is not exist");
              redirect("newEntry.php");
          }
  }
  ?&gt;
  </code></pre>
  
  <p>where image is  the path of my image :</p>
  
  <pre><code>    $path = "upload/". $picture_name;
  
      move_uploaded_file($picture_tmp,$path)
  
      $insQuery = "insert into image(name,image,price,description) values('".$name."','".$path."','".$price."','".$desc."')";
  </code></pre>
  
  <p>i get the " illegal string offset 'image' error , and no file exist error.
  why ??</p>