Reputation: 1007
This question is almost what I want:
How to import an excel file in to a MySQL database
but there is an extra part which I will ask here.
From this last question, the answer said to use LOAD DATA INFILE
. But doesn't this assume that I already have my table structure created within the database? In my case I have an excel file with about 100 columns and I don't want to have to create a table with all these columns first.
So my question: Is there a way to use the first row of the excel file to be the names of the columns in the database table?
Upvotes: 0
Views: 15489
Reputation: 12412
Since you're using phpMyAdmin, here's what I would do:
If your file is huge, you may have trouble because PHP limits the amount of time and memory phpMyAdmin is permitted to use. You can work around that by importing the file in stages.
Good luck.
By the way, 100 columns sounds excessive; you may want to check to make sure you're storing your data in the most optimal way.
Upvotes: 4