<?php
require "../model/configuration.php";
if(isset($_POST['recordToDelete']))
{
$id=$_POST['recordToDelete'];
$delquery=$db->execute("delete from purchase_temp where id='$id'");
}
$q=$db->execute("select * from purchase_temp");
$num=$q->num_rows;

if($num==0){
$delquery=$db->execute("TRUNCATE TABLE purchase_temp");
}
?>