开发者

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

开发者 https://www.devze.com 2023-01-07 17:40 出处:网络
There i开发者_开发知识库s 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?You are looking for PHPExcel library i b

There i开发者_开发知识库s 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?


You are looking for PHPExcel library i believe.

http://phpexcel.codeplex.com/


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


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.


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/


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

0

精彩评论

暂无评论...
验证码 换一张
取 消