Code: Select all
<?php
$con=mysql_connect("localhost","root","");
if(!$con)
{
die('Could not connect:' . mysql_error());
}
$ms = $_POST["ms"];
$wtr = $_POST["wtr"];
if (!$wtr){$wtr = 1;}
$wtc = $_POST["wtc"];
if (!$wtc){$wtc = 1;}
$wtinter = $_POST["wtinter"];
if (!$wtinter){$wtinter = 1;}
$wtrf = $_POST["wtrf"];
if (!$wtrf){$wtrf = 1;}
mysql_select_db("dbo",$con);
$sql="INSERT INTO 'emp' ('PFno', 'Name', 'Title', 'Address', 'Designation', 'Marital', 'NICNo', 'TPHome', 'TPMobile', 'CName', 'CAddress', 'CTPHome', 'CTPMobile', 'ApDatePS', 'ApletterNo', 'IncreDate', 'TranDateCurr', 'WTFO', 'TransFOffice', 'WConfirm', 'IncDate', 'ExamPro', 'Winter', 'InteraDate', 'WTrans', 'TranDate', 'TransTOffice')
VALUES (
".$_POST['pfno']."',
'".$_POST['name']."','".$_POST['title']."','".$_POST['add']."','".$_POST['des']."','".$ms."','".$_POST['nic']."','".$_POST['tph']."','".$_POST['tpm']."','".$_POST['cname']."','".$_POST['cadd']."','".$_POST['ctpm']."','".$_POST['adateps']."','".$_POST['alno']."','".$_POST['incredate']."','".$_POST['tdatecur']."','".$wtr."','".$_POST['toff']."','".$wtc."','".$_POST['incredate2']."','".$wtinter."','".$_POST['incterdate']."','".$wtrf."','".$_POST['transferdate']."','".$_POST['transferoff']."'
;";
mysql_query($sql,$con);
mysql_close($con);
echo "One record added";
?>