Cannot import a large number of data solutions with Phpexcelreader

Source: Internet
Author: User
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!
------to solve the idea----------------------
/*
* phpexcel.v1.7.6 Version [read Example]
*/
Include ' phpexcel/iofactory.php ';
$filename = "D:/test.xls";
$readType = Phpexcel_iofactory::identify ($filename); Get without knowing the document type
$excelReader = Phpexcel_iofactory::createreader ($readType);
$PHPEXCELOBJ = $excelReader->load ($filename);
$currentSheet = $PHPEXCELOBJ->getsheet (0); Select the form with the first form (SHEET1) as the current action
$excelRows = $currentSheet->gethighestrow (); Get Maximum row
$excelColumn = $currentSheet->gethighestcolumn (); Get maximum column
foreach (Range (1, $excelRows) as $row) {
$line = '

';
foreach (Range (' A ', $excelColumn) as $column) {
$line. = $currentSheet->getcell ($column. $row)->getvalue (). ",";
}
$line. = '

';
Echo $line;
}



------to solve the idea----------------------
References:
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
...

Use this bar: http://www.phpclasses.org/package/6235-PHP-Parse-and-access-binary-Excel-files-in-pure-PHP.html

It feels good after use, supports Chinese, and supports xlsx format, which iterates through all the tables, columns, rows, and cells. Before also used Phpexcelreader, found more problems, so found this.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.