TCM
TCM

Reputation: 16900

How can i take an excel file, parse it contents and store the column's data of excel sheet in my database column?

There is one excel sheet which contains student name, rollno etc. How can i parse the contents of excel file and store that in my sql database?

Upvotes: 1

Views: 1077

Answers (5)

DBQ
DBQ

Reputation: 199

PHPExcel is one of the best PHP classes i have ever worked with. In addition to parsing and reading files of all Excel variations (including csv) the output to Excel 2007 + is excellent.

Be sure to look at the documentation and examples...they will get you up to speed very quickly

Upvotes: 1

Flakron Bytyqi
Flakron Bytyqi

Reputation: 3254

I'd recommend to you that you save it as csv, it's much more easier and less hacking to upload it to the database

here is simple a sample

http://www.bradino.com/php/csv-upload-to-database/

Upvotes: 1

Mark Baker
Mark Baker

Reputation: 212452

If you want to do it directly from the Excel file, rather than create an intermediate CSV using Excel's "Save As" options, then look at libraries such as PHPExcel that can read the xls binary format and make the data accessible to your PHP script.

Upvotes: 1

Adam Lukaszczyk
Adam Lukaszczyk

Reputation: 4926

use this class to read the excel files http://sourceforge.net/projects/phpexcelreader

Upvotes: 1

Sarfraz
Sarfraz

Reputation: 382806

You are looking for PHPExcel library i believe.

http://phpexcel.codeplex.com/

Upvotes: 2

Related Questions