reece_1989 Posted July 30, 2009 Share Posted July 30, 2009 how would i insert a blank date 0000-00-00 into my db? i have an update form that correctly converts from dd-mm-yyyy to yyyy-mm-dd: $Time26 = strtotime($update_T26); $Date26 = date('Y-m-d',$Time26); If i enter 0000-00-00 via phpmyadmin i get: 30-11--0001 displayed when converting the date in php page And if i enter nothing or 00-00-0000 in php page in the db i get: 31-12-1969 ??? any ideas Cheers Quote Link to comment https://forums.phpfreaks.com/topic/168109-insert-0000-00-00-into-date-field/ Share on other sites More sharing options...
JonnoTheDev Posted July 30, 2009 Share Posted July 30, 2009 Set the default value for the field to 0000-00-00 This is an invalid mysql date format: 00-00-0000 should be yyyy-mm-dd Quote Link to comment https://forums.phpfreaks.com/topic/168109-insert-0000-00-00-into-date-field/#findComment-886746 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.