Ok... I've stared at this for too long.
No matter what I've tried, my dates are entered into my database as 14 zeros. :eek: The field is a timestamp field, so I don't think that's what's wrong...
I've tried:
$today=getdate();
I've tried inserting the variable $today with and without single quotes around it.
I tried using mktime() with getdate():
function process_form(){
session_start();
$loginname=trim(strip_tags($_POST['username']));
$pswd=trim(strip_tags($_POST['password']));
$pass=md5($pswd);
$profile=trim(strip_tags($_POST['profile']));
$tstamp = mktime(0,0,0,$m,$d,$y);
$tdate = getdate($tstamp);
$_SESSION['username']=$loginname;
global $db;
$db->query('INSERT INTO customers (firstname, lastname, username, pswd, date, type, profile)
VALUES (?,?,?,?,?,?,?)',
array($_POST['firstname'],$_POST['lastname'], $_POST['username'], $pass, $tdate, 'empe', $profile));
echo "<br>Thank you! Your data has been entered.\n";
}
But no matter what I try, I just can't seem to get an actual DATE in my database!
Any thoughts? None of the posts I've seen on dates seem to have the answer for me.
Thanks,
eCat