Can't import large amount of data with Phpexcelreader, how to solve it

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!

------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 ...
  • 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.