williamZanelli Posted June 4, 2009 Share Posted June 4, 2009 Hi guys, I want to display/store the full date format in my database... such as Thu, 04 Jun 2009 18:58:56 +0100 My date field in the database, is "date" - type. In the PHP I use the following code, and wehn echoed it prints out the right date $date2 =date("D, d M Y H:i:s O"); However everytime I try to insert, mySQL this throws an error Where am i going wrong? Thanks in advance guys for your thoughts Will Quote Link to comment https://forums.phpfreaks.com/topic/160958-solved-php-date-problem/ Share on other sites More sharing options...
gijew Posted June 4, 2009 Share Posted June 4, 2009 Err, let me modify that. I missed the part where you said date type Is it datetime or date? Quote Link to comment https://forums.phpfreaks.com/topic/160958-solved-php-date-problem/#findComment-849426 Share on other sites More sharing options...
Maq Posted June 4, 2009 Share Posted June 4, 2009 Why don't you use the MySQL date functions instead? Quote Link to comment https://forums.phpfreaks.com/topic/160958-solved-php-date-problem/#findComment-849470 Share on other sites More sharing options...
williamZanelli Posted June 4, 2009 Author Share Posted June 4, 2009 Thanks for that "gijew" Set me off in the right direction.. I modified the DB to DATETIME, and in the PHP use NOW() Works like a charm ;D Quote Link to comment https://forums.phpfreaks.com/topic/160958-solved-php-date-problem/#findComment-849471 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.