Hi, I am trying to insert data into 3 tables using mysql.. At first, I was able to insert in the first table (staffinfo), after coding for the second table insert (empinfo), It inserted into second table without inserting in first table AND finally it echoes 1 record added Successfully without inserting in the first, second, third table respectively .. ( staffinfo, empinfo, peninfo). I am a NEWBIE...kindly assist me in faulting my codes for correction..
`<html>
<body>
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect Jaree: ' . mysql_error());
}
mysql_select_db("coapen", $con);
$sql1="INSERT INTO staffinfo (title, name, gender, dob)
VALUES
('$_POST[title]','$_POST[fullname]','$_POST[sex]','$_POST[dob]')";
mysql_query($sql1);
$sql2="INSERT INTO empinfo (file_no, rank, gl, step, fad, pad, dept, division)
VALUES
('$_POST[fileno]','$_POST[rank]','$_POST[gl]','$_POST[step]','$_POST[first]','$_POST[pre]','$_POST[dept]','$_POST[div]')";
mysql_query($sql2);
$sql3="INSERT INTO peninfo (pfa, rsa, month, year, ba, hsa, tpa, employee _c, employer _c, total, remarks)
VALUES
('$_POST[pfa]','$_POST[rsa]','$_POST[month]','$_POST[year]','$_POST[basic]','$_POST[house]','$_POST[tp]','$_POST[employee]','$_POST[employee]',,'$_POST[total]',,'$_POST[rem]',)";
mysql_query($sql3);
echo "1 record added Successfully";
mysql_close($con)
?>