<?php
include ("../../session.php");
include("../../connect.php");
$user=$_GET['user'];

$query=mysql_query("select * from product where status='removed'");
while($display=mysql_fetch_array($query)){
		
	$pic=$display['productPic'];
	$id=$display['id'];
	//just edit path name
	unlink("../../company/album/$pic");
	mysql_query("UPDATE product set status='clear' where id='$id'");
	
	}

  // echo "Directory has been created successfully...";
	mysql_query("UPDATE product SET pName = null, type = null, price=null, productPic=null, detail=null, dateInsert=null, dateRemove=null
					WHERE status = 'removed'");
			
mysql_close($login);
?>