<body background="blater01.gif" topmargin=0>
<?php include ("../../include/dbconnect.php");

 
# INCREMENT THE BUYERCODE BY FINDING THE MAXIMUM NUMBER

 $result1=mysql_query("select max(bcode) from buy where areacode = '$area' ");
 $row1=mysql_fetch_row($result1);
 $tbcode=$row1[0];
 if(empty($tbcode))
   { 
   	$tbcode=$area.'0000001'; 
	}
 else
 { 
 	$tbcode=$tbcode+1; 
 } 
 
 
  
if (!empty($tbcode) && !empty($bname))
{

$query="insert into buy  values('$tbcode','$bname','$baddress1','$baddress2','$bcity','$bstate','$country','$bpin','$bemail','$bst','$bcst','$tin','$bstd','$btelno','$bfax','$bgram','$contact','$area','$buyertype','$ttype','$eccno','$vendercode','$groupcode','$credit','$unit',NULL)";

	mysql_query($query) or 	die(mysql_error());
}
?>
<h2>
	<h2>Thanks !! </h2>
	<h2><a href= "view.php"> View Customers !!! </a></h2>



<br><br><font size=1><center><a href= "index.html">Return to index page</center></font>


