当前位置:网站首页>PHP about problems such as memory overflow timeout caused by large amount of data exporting or traversing data
PHP about problems such as memory overflow timeout caused by large amount of data exporting or traversing data
2022-07-28 16:27:00 【Sun Fendou】
**
php With regard to the large amount of data, exporting data or traversing data leads to memory overflow timeout and other problems
**
Don't talk much, just go to the code
$p = 0;$pageSize=100; // Define the number of display bars per page
set_time_limit(0);// This is a fairy function. It's great , Its main function is to : Set the maximum execution time of the script , The unit is in seconds . If set to 0( zero ), There is no time limit .
while (
$list = db('user')->order('a.id desc')->limit($p*$pageSize, $pageSize)->select()// Get data per page , To separate
) {
foreach ($list as $k=>$v) {
// The following content is the exported list content copy can be omitted
$index = $k + $p * $pageSize + 3;
// switch ($v['type']) {
// case 1:
// $lx = ' Online order ';
// break;
// case 2:
// $lx = ' Offline order ';
// break;
// default:
// $lx = '';
// }
// $address = json_decode($v['address'], true);
$objPHPExcel->getActiveSheet()
->setCellValue('A'.$index, $v['uname'])
->setCellValue('B'.$index, $v['bid'].' ')
->setCellValue('C'.$index, $v['pid'].' ')
->setCellValue('D'.$index, $v['amount'].' ')
->setCellValue('E'.$index, $v['f_amount'].' ')
->setCellValue('F'.$index, $v['open_bank'])
->setCellValue('G'.$index, ' '.$v['card_number'].' ')
->setCellValue('H'.$index, $v['jg_name'].' ')
->setCellValue('I'.$index, ' '.$v['jg_number'].'')
->setCellValue('J'.$index, ' '.$v['id_card_code'].'');
$objPHPExcel->getActiveSheet()->getRowDimension($index)->setRowHeight(16);
}
$p++;// Page number increase
}
If you don't understand, you can change careers !
边栏推荐
- Qt学习之安装
- LabVIEW LINX Toolkit控制Arduino设备(拓展篇—1)
- 1. Simple command line connection to database
- flashfxp 530 User cannot log in. ftp
- Roson的Qt之旅#102 ListModel
- Voltage to current / current to voltage module
- 李宏毅《机器学习》丨4. Deep Learning(深度学习)
- 深入理解Istio流量管理的熔断配置
- Mlx90640 infrared thermal imager temperature sensor module development notes (VIII)
- I'll show you a little chat! Summary of single merchant function modules
猜你喜欢

c语言编程当中两个!!的作用

mysql查询 limit 1000,10 和limit 10 速度一样快吗?如果我要分页,我该怎么办?

资本「断供」两年,我只能把公司卖了

LabVIEW Linx toolkit controls Arduino equipment (expansion-1)

SCI scientific paper writing Growth Camp (full version)

Dynamic programming -- digital statistics DP

About standard IO buffers

我在上海偶遇数字凤凰#坐标徐汇美罗城

Two of C language programming!! Role of

解决电脑恶意广告弹窗的思路
随机推荐
跳表的实现
Pop up layer prompt in the background
关于标准IO缓冲区的问题
2021 Yahong pen test question 2
解决uniapp等富文本图片宽度溢出
软考 系统架构设计师 简明教程 | 软件调试
JS queue
High precision absolute angle sensor application high speed angle monitoring
Huada chip hc32f4a0 realizes RS485 communication DMA transceiver
Notes on October 22, 2021
QT打包
Two of C language programming!! Role of
Stm32cube infrared remote control: input capture
[Multisim Simulation] LM339 zero crossing circuit simulation
Wechat official account to obtain material list
动态规划 --- 数位统计DP
ANSA二次开发 - 抽中面的两种方法
Darknet training yolov4 record
Sudden! MSI CEO Jiang Shengchang fell to death
Qt学习第一天