jcadima
3/26/2017 - 3:54 PM

Insert Dates into Mysql Table DATE type

Insert Dates into Mysql Table DATE type



http://stackoverflow.com/questions/12120433/php-mysql-insert-date-format

<?php
// Here date_added is of type DATE 
// Format to MySQL Date ->   YYYY-MM-DD  or it wont write values 
$date_added = explode('/', $_POST['date_added'] ) ;
$date_added = $date_added[2] . '-' . $date_added[0] . '-' . $date_added[1] ;

$shipment_date = explode('/', $_POST['shipdate'] ) ;
$shipment_date = $shipment_date[2] . '-' . $shipment_date[0] . '-' . $shipment_date[1] ;