title: Delete more than one file using unlink
body: <p>Hi I got this simple delete script, but I can only get it to delete one file in the folder. I tried some different stuff trying to loop the unlink but it wont work. Does anyone knows how it is done?</p>
  
  <pre><code>$id = $_GET['id'];
  $sql_get = "SELECT shop.id, shop.overskrift, shop.pris, shop.text, shop_pictures.ShopPictures_id, shop_pictures.shop_pictures_file
              FROM shop INNER JOIN shop_pictures
              ON shop.id = shop_pictures.fk_shop_pictures_shop_id WHERE Id=$id";
  $result_get = mysqli_query($connection, $sql_get);
  $row = mysqli_fetch_all($result_get);
  
  $sql = "DELETE FROM shop WHERE Id=$id";
  $result = mysqli_query($connection, $sql);
  
  $sql = "DELETE FROM shop_pictures WHERE fk_shop_pictures_shop_id=$id";
  if(!empty($row)) {
      foreach($row as $data) {
          unlink('../../img/shop_pictures/'.$data['shop_pictures_file']);
      }
  }
  $result = mysqli_query($connection, $sql);
  
  //header('Location: ../members.php');exit;
  </code></pre>