jeffrydell Posted August 13, 2007 Share Posted August 13, 2007 How do I take a date that was entered by a site visitor (format: mm/dd/yyyy) and convert it properly for storing in a MySQL date field? I figured out the MySQL to 'human' function: function dateshow($dbdate) { $m = substr($dbdate,6,2); $d = substr($dbdate,9,2); $y = substr($dbdate,1,4); return date("m/d/Y", mktime(0,0,0,$m,$d,$y)); } but don't understand what I need to do to 'send it back' to the table in a format that MySQL will 'like'. Thank you for your help! Link to comment https://forums.phpfreaks.com/topic/64608-solved-storing-a-date-in-mysql/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.