Originally posted by Sharif
So what's the best way of inserting into a datetime field?
$dtime = date('Y-m-d G:i:s');
$result = mysql_query("insert into table ('datetimecolumn') values ('$dtime');
like that maybe?
or if you plan on using the current time/date....
INSERT INTO table ('datetimecolumn') values (now());
or...
function now()
{
return date('Y-m-d G:i:s');
}