I've got a CSV file with 9 columns and I have a MySQL table with 11 columns.
The CSV file looks like:
col1, col2, col3, col4, col5, col6, col7, col8, col9
and the MySQL table looks like:
col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11
I need to get the script to ignore the two erroneous (but required) MySQL columns.
The mysql columns that need to be ignored in the import are: db_id & nice_date =)
This is what I have so far:
$sql = 'LOAD DATA LOCAL INFILE "../csvtemp/test.csv"
INTO TABLE sample
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY """"
IGNORE 1 LINES'
;