Cannot import large amounts of data with Phpexcelreader

Source: Internet
Author: User
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!


Reply to discussion (solution)

Then you try it out in batches. 100 or 122 at a time.

, the main is unable to determine how many data each import, it is possible to import only 10, it is possible to import 8,000, so do not know how to do oh

Then you try it out in batches. 100 or 122 at a time.

is the imported data in Chinese? If there is, the estimate is not too much to deal with, has not been a good tinker with Chinese characters, I originally uploaded an Excel thing, I now use it, 10,000 data at a time is no problem, but slower

There is a Chinese oh, you are still there, can you send me to see AH, hey!

is the imported data in Chinese? If there is, the estimate is not too much to deal with, has not been a good tinker with Chinese characters, I originally uploaded an Excel thing, I now use it, 10,000 data at a time is no problem, but slower

You used the session, the maximum value.

How about this? :

# Read and display the entire contents of the CSV file
 
  
\ n "; $row + +; for ($c =0; $c < $num; $c + +) { echo $data [$c]. "
\ n "; }} Fclose ($handle);? >

No use, where can you see the use of the session?

You used the session, the maximum value.

But to import an Excel file, the suffix name is xls.

How about this? :
PHP Code

# Read and display the entire contents of the CSV file

$row = 1;
$handle = fopen ("Test.csv", "R");
while ($data = Fgetcsv ($handle, 1000, ",")) {
$num = count ($data);
echo "

$num fields on line $row: ...

/* * 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;}


Refer to the sticker:
Http://topic.csdn.net/u/20120517/11/746a745b-27dd-4f54-9882-80d3bf68fb15.html

I went to this post at the end of the site to download the latest phExcelReader2.21, or can not print out more than 122 of the content, 121 or more in the print out.

Refer to the sticker:
Http://topic.csdn.net/u/20120517/11/746a745b-27dd-4f54-9882-80d3bf68fb15.html

Import the message queue and put it under the line.

Seems a little advanced, is there an example?

Import the message queue and put it under the line.

Seems a little advanced, is there an example?
Reference to the 13 floor of the reply:

Import the message queue and put it under the line.



This is the reply to your other post, not the problem.

Refer to other people's cases online. Start with the basics.

Some time ago I used this class, the import of 2000 lines of Excel file will fail, but 500 lines of Excel is no problem.

What's going on, do you have a solution?

Some time ago I used this class, the import of 2000 lines of Excel file will fail, but 500 lines of Excel is no problem.

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.

Strange, use this to import 122, 123 can not. You download my Excel to try

Reference to the landlord's reply:
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 ();
$da ...

Mine is 281 ... After 281, it cannot be imported.

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