Hello,
Try the following.
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("newcrm", $con);
$sql = sprintf("INSERT INTO common (refno, date, agentname, zcno, callerid) VALUES ('%s', '%s', '%s', '%s', '%s')",
mysql_real_escape_string($_POST[refid]), $_POST[date], mysql_real_escape_string($_POST[agentname]),
mysql_real_escape_string($_POST[zcno]), mysql_real_escape_string($_POST[cid]));
$ret = mysql_query($sql, $con);
if (!ret) {
$message = 'Invalid query: ' . mysql_error() . "\n";
die($message);
}
$sql1 = sprintf("INSERT INTO enquiry (refno, customername, category, comments) VALUES('%s', '%s', '%s', '%s')",
mysql_real_escape_string($_POST[refid]), mysql_real_escape_string($_POST[cname]),
mysql_real_escape_string($_POST[catg]), mysql_real_escape_string($_POST[commts]));
$ret = mysql_query($sql1, $con);
if (!ret) {
$message = 'Invalid query: ' . mysql_error() . "\n";
die($message);
}
mysql_close($con)
?>
Regards,