title: Why When i deleted image from database not deleted also from server folder?
body: <p>The problem is that the deletion is done only from the database and not from the server folder also. Is there an error with my code?</p>
  
  <p>This deleteIMG.php</p>
  
  <pre><code>&lt;?php
  include('dbh.inc.php');
  if (isset($_POST['submit4'])) {
  
  
  
      //DELETE FILE
      $del_img=$_GET['name'];
      $queryy = "DELETE FROM table1 WHERE name='$del_img'";
      $result = mysqli_query($conn, $queryy);
  
      if ($result) {
          ?&gt; &lt;script&gt; alert('This image has been deleted.'); window.location ="/pages/pictures.php"; &lt;/script&gt;
          &lt;?php 
          unlink("/pages/uploads/$del_img");
      } else {
          ?&gt;
          &lt;script&gt; alert('This image not yet deleted.'); window.location ="/pages/pictures.php"; &lt;/script&gt;
          &lt;?php
      }
  }   
  
  
  
  
  ?&gt;
  </code></pre>