Cannot import large amounts of data with Phpexcelreader
I found an example on the Internet, you can import the Excel file into the database through Phpexcel, but once the data is more than 122, such as 123 data in an Excel file cannot be imported. I'm talking about code stickers, everybody look at:
Require_once '. /phpexcelreader/excel/reader.php ';
$data = new Spreadsheet_excel_reader ();
$data->setoutputencoding (' GB2312 ');
$data->read ('.. /lfx.xls ');
}
for ($i = 1; $i <= $data->sheets[0][' numrows '); $i + +)
{
for ($j = 1; $j <= $data->sheets[0][' numcols '); $j + +)
{
echo $data->sheets[0][' cells ' [$i] [$j];
}
}
The above code in the Excel file is less than 123 can print out all the records on the Web page, but greater than or equal to 123 is blank, and I need to import more than 5,000 data, distress.
Attach Phpexcelreader as well as my Excel
Thank you all!
------Solution--------------------
PHP Code
/* * phpexcel.v1.7.6 Version [read Example] */include ' phpexcel/iofactory.php '; $filename = "D:/test.xls"; $readType = Phpexcel_ Iofactory::identify ($filename); Gets $excelreader = Phpexcel_iofactory::createreader ($readType) without knowing the document type; $PHPEXCELOBJ = $excelReader->load ($ filename); $currentSheet = $PHPExcelObj->getsheet (0); Select the first form (SHEET1) for the current action form $excelrows = $currentSheet->gethighestrow (); Gets the maximum row $excelcolumn = $currentSheet->gethighestcolumn (); Gets the maximum column foreach (range (1, $excelRows) as $row) {$line = ''; foreach (Range (' A ', $excelColumn) as $column) {$line. = $currentSheet->getcell ($column. $row)->getvalue (). ","; } $line. = '
'; echo $line;}
------Solution--------------------
discuss
I found an example on the Internet, you can import the Excel file into the database through Phpexcel, but once the data is more than 122, such as 123 data in an Excel file cannot be imported. I'm talking about code stickers, everybody look at:
Require_once '. /phpexcelreader/excel/reader.php ';
$data = new Spreadsheet_excel_reader ();
$data->setoutput ...