简体   繁体   English

PHP_XLSXWriter_plus大型Mysql数据集缺少数据

[英]PHP_XLSXWriter_plus Missing Data For Large Mysql Data Sets

I am trying out this library, because PHPExcel is in capable of not using up 3GBs of ram (probably more) when trying to download 143,000+ mysql records. 我正在尝试这个库,因为在尝试下载143,000多个mysql记录时,PHPExcel能够使用不超过3GB的ram(可能更多)。 So far this library has been an improvement as I can generate an .xlsx file without exhausting the php memory limit. 到目前为止,此库已得到改进,因为我可以生成.xlsx文件而不会耗尽php内存限制。

However, I am running into a problem where it fills in most of the data, but a couple of columns have only 3\\4 of the expected values and other columns is a hit or miss if it fills in the value for a particular cell. 但是,我遇到了一个问题,其中它填充了大多数数据,但是有几列只有3 \\ 4的期望值,而其他列如果填充了特定单元格的值则是命中或未命中。

For example, one column is called Submit Date and its format is datetime in the database, but a string from the php query. 例如,一列称为“提交日期”,其格式为数据库中的datetime,但是来自php查询的字符串。 Out of 143,828 rows of data only the first 19,483 rows have the date values filled in. 在143,828行数据中,只有前19,483行填充了日期值。

I can confirm that the missing values in the submit date column and the other missing cells do have a value\\data within the mysql database. 我可以确认提交日期列中的缺失值和其他缺失的单元格在mysql数据库中确实具有value \\ data。 Also, the submit date column is used in a ORDER BY clause in the mysql query in case that has anything to do with this problem. 另外,如果与该问题有任何关系,则在mysql查询的ORDER BY子句中使用Submit date列。

So I am trying to figure out if this is a (common?) problem with this library when downloading a large data set? 所以我试图找出这是下载大型数据集时此库的(常见吗?)问题? Or the problem more lies more on my code up until calling on this library to generate the .xslx file. 否则问题就更多地在于我的代码,直到调用此库以生成.xslx文件为止。

Thanks. 谢谢。

try to load not all rows at once... 尝试一次不加载所有行...

sample: php + js 范例:php + js

  1. php http://pastebin.com/ZLsNXayd php http://pastebin.com/ZLsNXayd

  2. js http://pastebin.com/QvPux6Hs js http://pastebin.com/QvPux6Hs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM