I will given an Excel sheet with many records(more than 1000 records).
I have to upload few fields of this excel sheet into Mysql. For each record a unique id will be assigned using an auto increment field in Mysql.
Now i have to create a single XML file for the Excel sheet along with the unique id assigned in Mysql table.
Is there a way i can automate the process or what will be a simplest way to do it?
Automation will be somewhat limited because you need to validate the input against your business rules. Some fields are required, formatting may be important for some and the allowed entries may have a constrained list. You can just shove the data in, but it will break on invalid entries. That is probably not acceptable.
If the following is helpful, I have a PHP function that I wrote that makes it easy to convert a delimited upload file (tabs in the example) into an array keyed to the column names. Once you have this you can iterate the data structure to do validation and do inserts. For very large data sets a
LOAD DATAMySQL command will be more performant though.This does mean that your users upload a tab-delimited file instead of Excel, but it is easy for them to save in that format. You can likely use the http://phpexcel.codeplex.com/ if you need the upload format to be Excel.