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 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 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
Archived
This topic is now archived and is closed to further replies.