I have a forum in PHP which takes a date like in the form dd/mm/yyyy hh:mm:ss. However, I need to insert it for SQL as a DATETIME in the format as yyyy-m
dd/mm/yyyy hh:mm:ss
yyyy-m
Two of several possible ways:
$mysqldate = date( 'Y-m-d H:i:s', $phpdate );
$query = "UPDATE table SET datetimefield = FROM_UNIXTIME($phpdate) ...";