$db=mysql_select_db("qserves1_uksurvey", $con);
$sql = "SELECT * FROM forms WHERE Number='".$_POST['Number']."'";
$res = mysql_query($sql, $con) or die (mysql_error());
if(mysql_num_rows($res)>0)
{
echo 'forms already exist with number:'.$_POST['Number'];
exit;
}
else
{
$sql="INSERT INTO forms (date, Receivingsky, Title, Firstname, Lastname, House, Street, Town, County, Postcode, Number, WarrantyCoverForSky, Tvmake, Warrantycover, Payingmonthly, Agentnotes, Agentname)
VALUES
(NOW(),'$_POST[Receivingsky]','$_POST[Title]','$_POST[Firstname]','$_POST[Lastname]','$_POST[House]','$_POST[Street]','$_POST[Town]','$_POST[County]','$_POST[Postcode]','$_POST[Number]','$_POST[WarrantyCoverForSky]','$_POST[Tvmake]','$_POST[Warrantycover]','$_POST[Payingmonthly]','$_POST[Agentnotes]','$_POST[Agentname]')";
$sql_result = mysql_query($sql, $con) or die (mysql_error());
}
Same with second table.
Try it and let me know still there is no fix.