<?php
include 'db_connect.php';

if($_GET['mode']=='insertgml')
{
$sql1="delete from commst where  compid='$_POST[buyer_code]' ;";	
$sql2="INSERT INTO `commst` (`id`,  `compid`, `name`, `address`,`cmpcity`, `telephone`, `email`, `type`) VALUES (NULL,  '$_POST[buyer_code]', '$_POST[company]', '$_POST[address]', '$_POST[address]', '$_POST[buy_city]', '$_POST[buy_email]', 'CUSTOMER');";
}


if(!empty($sql2))
{
	mysqli_query($con,$sql1);
if(mysqli_query($con,$sql2))
echo "Record Added To Masters";
else
echo "Error: mysqli_error($con)";
}
mysqli_close($con);


?>