I'm trying to import a csv file into a table. When I run the query the date_altered column does not populate properly.
Insert query:
xtc_db_query("
LOAD DATA INFILE '".$bpmand."'
INTO TABLE bpmand_update
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"'
LINES TERMINATED BY '\r\n'
(@skip, customers_id, @skip, @skip, date_altered, @skip)
");
Other info -
Table creation:
$createtable = '
CREATE TABLE bpmand_update
(
orders_id int(11),
customers_id int(11),
bonuspoints_received int(11),
bonuspoints_spent int(11),
current_bonuspoints int(11),
date_altered datetime,
comment varchar(50));';
xtc_db_query($createtable);
The csv file looks like:
"1260","13-11-2013 11:45:45"
"5222","09-01-2014 11:45:45"
Edit: If I got to phpmyadmin and run
INSERT INTO bpmand_update (customers_id, date_altered) VALUES ("1260","13-11-2013 11:45:45")
Everything is fine
Y-m-d H:i:s09-01-2014the 1st of September, or the 9th of January?2014-01-09format eliminates ambiguity, it's the 9th of January