maestro416
maestro416

Reputation: 924

Can I create a mysql database where the data is imported from excel files then displayed through a UI

I wanted to know if it would be possible to import an excel file into a databse? The columns for the MySQL database would have the same columns that the excel file would have and the title of the excel file.

So for example if I have a file named BL#123456 I would like to be able to take the data in that file and have it outputted to a user as "x y z a b c BL#".

I think I understand the process of data import from excel into MySQL the only thing is the file name to appear along side the columns.

Also I would be using a PHP script to import the data.

EDIT: How do I get it to import the file name as well as the data

Upvotes: 1

Views: 189

Answers (1)

invertedSpear
invertedSpear

Reputation: 11054

Would it work if you did this?

1) create your table (include an additional column for the file name)
2) import a spreadsheet (you probably have collected the file name at this point, so stick it in a variable)
3) after importing each spreadsheet, run an update on your table UPDATE TABLE set fileName = $variable WHERE filename is null

Upvotes: 1

Related Questions