get datetime filed to mysql db
Posted: Tue Sep 02, 2003 8:28 am
Hi all,
I need to store the directory date (modify date) to mysql db.
I have a datetime field and here is the code I wrote:
$dDate=date("Y m d H i s", filemtime("$path"));
$insSql="INSERTINTO table (path,mdate) VALUES ('$path','$dDate')";
mysql_query($insSql);
the path is stored correctly but the date reamins empty and appear in the db.
0000-00-00 00:00:00
How can I correct it?
Thanks
I need to store the directory date (modify date) to mysql db.
I have a datetime field and here is the code I wrote:
$dDate=date("Y m d H i s", filemtime("$path"));
$insSql="INSERTINTO table (path,mdate) VALUES ('$path','$dDate')";
mysql_query($insSql);
the path is stored correctly but the date reamins empty and appear in the db.
0000-00-00 00:00:00
How can I correct it?
Thanks