Results 1 to 2 of 2
Jan 27, 2002, 16:13 #1
importing from ms excel into mysql
i am using phpmyadmin and i am trying to import a file from ms excel. i keep getting this:
LOAD DATA LOCAL INFILE '/tmp/phpVldW6D' INTO TABLE `fans` FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\r\n' (`Invoice`, `Day`)
Unknown column 'Invoice' in 'field list'
is there an inside track to killing any learning curve??? any one with any experience with tis it would be appreciated.....
Jan 27, 2002, 17:10 #2
- Join Date
- Jun 2001
- Tallahassee, FL
- 0 Post(s)
- 0 Thread(s)
Every few months I have to update a HUGE MySQL database from an excel file.
What I do is make sure that the columns match up. Because when you're using that Load Data Local Infile command, if there is a variation in the number of fields, you get shanked. (my guess is that this is what's happening to you)
Also make sure that the first field in your excel spreadsheet lines up with the first field in the DB table.
Lastly, it looks like you're telling it that the fields are terminiated by ;'s ... I usually export excel spreadsheets as CSV (comma separated) or TSV (tab separated) depending on if there are commas in the information you're inserting.