Thats because you are overwriting the first $sql variable with the second one!
PHP Code:
$foo = 1;
$foo = 2;
// $foo will equal 2
Simply use 2 mysql_query calls
PHP Code:
//entering the job seeker data IN the user table
$sql="INSERT INTO user (name, Addr, Nation, dob, Gen, cnt, mar, mil, phone, mobile, mail, user)
VALUES
('$fn','$_POST[add]','$_POST[nat]','$dob','$_POST[gg]','$_POST[cnt]','$_POST[Mar]','$_POST[Mil]','$_POST[ph]','$_POST[mo]','$_POST[mail]','$_POST[user]')";
//entering the user AND pass IN the login table
$sql2="INSERT INTO login (user, pass, type)
VALUES
('$_POST[user]','$_POST[pass]','$_POST[type]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
if (!mysql_query($sql2,$con))
{
die('Error: ' . mysql_error());
}
echo "<br>";
echo "<br>Thanks for registration MR. $fn ";
exit();
Bookmarks