php Import Excel sheet to mysql cakephp 1.3

2019-08-29 03:58发布

问题:

I will have millions of records in my Excel sheet provided by client, and I am finding a better ready made component or helper in CakePHP 1.3 version to import excel sheet to MySQL database records.

Please let me know earliest response with better solution.

回答1:

You need to use PHP-Excel-Reader

For that you have to add excel reader library in your Vendor folder like this vendors\php-excel-reader and yourdatafile.xls should be under webroot folder

function index(){
App::import('Vendor', 'php-excel-reader/excel_reader2');
$data = new Spreadsheet_Excel_Reader('yourdatafile.xls', true);

}


回答2:

I havent found a Plugin for CakePHP which does extensive work.

But you can use PHP Excel as vendors and just import it into the controller and go ahead and do everything.



回答3:

try using it

It works fine for me. Hope it helps u too