title: PHP Delete Multiple File Image in folder
body: <p>I have trouble when i want delete Multiple File Image in folder, i can delete the image in folder but just 1 image, other image can't delete in folder although in DB the image is 1 id, this my script</p>
  
  <pre><code>if (ISSET($_POST['remove_product'])) {
  require("../koneksi.php");
  $id = $_POST['id'];
  $cari=mysql_query("select * from t_productimage where id_product='$id'");
  $dt=mysql_fetch_array($cari);
  $gmbr=$dt['image'];
  $tmpfile = "../images_product/$gmbr";
  $sql=mysql_query("DELETE a.*, b.*, c.* FROM t_product a, t_productsize b, t_productimage c WHERE a.id = '$id' AND b.id_product = '$id' AND c.id_product = '$id'");
  if(!$sql){
  echo '&lt;script language="javascript" type="text/javascript"&gt;
      alert("delete gambar gagal !");&lt;/script&gt;';
          echo "&lt;meta http-equiv='refresh' content='0; url=home.php?p=product'&gt;";
      }else{
              unlink ($tmpfile);
  echo "&lt;meta http-equiv='refresh' content='0; url=home.php?p=product'&gt;";
      }
  exit();
  }
  </code></pre>
  
  <p>thks a lot for responsed</p>