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?
chown linux:users\ /world
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?
I would also like to know more about this and if there is a script that I can use then I would like to know where it is if anybody knows.
The reasons for this is because I am doing a project where it will involve me uploading large amounts of data to my mysql database in one go.
So please could somebody help.
You might want to lok at
LOAD DATA INFILE.
If, however, you need to process the CSV data in some way, an dyou are using PHP, then look at fgetcsv.
Hope this helps