Reputation: 16900
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
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
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
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
Reputation: 4926
use this class to read the excel files http://sourceforge.net/projects/phpexcelreader
Upvotes: 1