How to Upload Excel File to Single MySQL Table? [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
开发者_Go百科 Improve this questionI've seen lots of examples of bulk uploading CSV files to MySQL. However, I have the need to utilize an Excel file, and don't want to trouble the user with saving as CSV. Can anyone provide links to PHP routines they use that will read large Excel files, match the column names to database table columns and upload large (>5k records) efficiently?
Thanks much!
You'd need to use something like PHPExcel to read/parse the Excel files. As for mapping columns to tables, that depends entirely on if the user actually bothers to put column headers into the spreadsheet. If they don't, then you'll just have to guess and it'll undoubtedly NOT work out nicely.
Allowing arbitarirly formatted spreadsheets anywhere near a database makes me cry...
精彩评论