$dupesql = "select t_id,sum(amount) as amounts from transfer WHERE acc_no='$acc_no1' AND agent_id='$agent_id' group by acc_no having sum(amount) < 25000";
$duperaw = mysql_query($dupesql);
if (mysql_num_rows($duperaw) > 0) {
$sql = mysql_query("INSERT INTO `transfer`(`t_id`, `agent_id`, `agent_name`, `date`, `name`, `phone`, `email`, `tname`, `tphone`, `temail`, `acc_no`, `bank`, `branch`, `code`, `amount`, `comment`, `status`) VALUES (NULL,'$agent_id','$agent_name','$date','$name','$phone','$email','$tname','$tphone','$temail','$accno','$bank','$branch','$code','$amt','$cmmnt','$status')");
echo '<script language="javascript">alert("Your Order has been Received \n You will be Notified via SMS/Email when the money is Transfered");window.location="../my.php"</script>';
}
else{
echo '<script language="javascript">alert("Your Account has been Used more than the limit i.e 5 Times!!!\n Please Contact !!!");window.location="../my.php"</script>';
}