Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Basic help with php Date()


impact - 2:37 am on Sep 2, 2010 (gmt 0)


Hello,

I am trying to insert date('M-d-Y') into mysql database using PHP. I have set the mysql table as DATE

Here is my code:
$creationDate = date('M-d-Y');

mysql_query("INSERT INTO eventDate (A,B,creationDate,D) VALUES ('','','$creationDate','') ");

The query runs without any error but in the database all I can see is
0000-00-00 and nothing actually gets updated.

In the next step, I want to subtract the current date with the date in the database to calculate how many days has passed since the creation date.

Any help will be appreciated.

Thank you,


Thread source:: http://www.webmasterworld.com/php/4195398.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com