My form is:
insert.php file:
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_db", $con);
$sql="INSERT INTO person (FirstName, LastName, Age)
VALUES
('$_POST[firstname]','$_POST[lastname]','$_POST[age]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con)
?>
How do I add in timestamp(yyyymmddhhmmss) into the form and file so it is stored in my database?
Thanks
2007-08-20
11:28:48
·
1 answers
·
asked by
S J
1
in
Programming & Design