tags:

views:

55

answers:

5

Hello,

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?

+2  A: 

You are looking for PHPExcel library i believe.

http://phpexcel.codeplex.com/

Sarfraz
+1  A: 

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

Dobiatowski
Hi Dobiatowski, The links aren't working. I am not able to download the class.
Ankit Rathod
OK! I change the mirror. Now it got downloaded.
Ankit Rathod
+1  A: 

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.

Mark Baker
+1  A: 

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/

Flakron Bytyqi
+1  A: 

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

DBQ