load data infile
Posted: Thu Aug 07, 2008 12:59 pm
hi there,
how can i set in the @datafield2 the value in $doc_date, so every time that i run the php script it set the date of server.
this is just an example of what i want to do ...
thanks in advance
how can i set in the @datafield2 the value in $doc_date, so every time that i run the php script it set the date of server.
this is just an example of what i want to do ...
Code: Select all
$doc_date = date('Y-m-d');
LOAD DATA INFILE 'example.csv' REPLACE INTO TABLE `content`
FIELDS TERMINATED BY ';'
OPTIONALLY ENCLOSED BY ''
LINES TERMINATED BY '\n'
(`ref`, @datefield1, @datefield2)
SET
`status_date` = STR_TO_DATE(@datefield1, '%d/%m/%Y'),
`doc_date` = ????;