Wanting to allow uploading Excel records into mySQL
Right now my contact manager website allows users to enter one new contact at a time. However, I can forsee the need to add hundreds at once, to save them the time in retyping everything.
Is there an easy way to upload rows in an Excel spreadsheet to a mySQL database? Is Excel the most popular format that I would want to accept?
Your best bet is to have your users save the Excel file as a CSV (Comma seperated values) file and upload that. The CSV is easy to work with. Each field is seperated by a comma and every row is seperated by a new line.
You would parse the CSV and insert each row (probably using a loop) and get your data that way.
To go this route, I would probably need to make sure that each of my users presents their data in their CSV the same way....right? (firstname, lastname, address, city, etc...)
Is there a place on the web where I can see a PHP example?
Bookmarks