lenr
12-04-2009, 07:43 AM
Hi there,
I have had a look at the posts, but cant find exactly the issue i am having.
I have a .csv file created from an excel sheet which I am trying to importing into a table in mysql, and the import works except that the data is not going into the correct fields.
syntax :
LOAD DATA LOCAL INFILE '/myfile.csv'
INTO TABLE mydatabase
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(name, number, id, mobile);
The field names are exactly the same are in the database, but go into the wrong fields. I use phpadmin, and have tried typing in the field names, and selecting them in the right hand window, but with the same result.
note: there are 65 fields in the table, and only 8 in the .csv
Thanks from sunny South Africa
I have had a look at the posts, but cant find exactly the issue i am having.
I have a .csv file created from an excel sheet which I am trying to importing into a table in mysql, and the import works except that the data is not going into the correct fields.
syntax :
LOAD DATA LOCAL INFILE '/myfile.csv'
INTO TABLE mydatabase
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(name, number, id, mobile);
The field names are exactly the same are in the database, but go into the wrong fields. I use phpadmin, and have tried typing in the field names, and selecting them in the right hand window, but with the same result.
note: there are 65 fields in the table, and only 8 in the .csv
Thanks from sunny South Africa