我想在后台运行代码..我想要这个同时下载需要大量时间的巨大报告..我已经浏览了几乎所有的谷歌网站,但仍然无法找到答案..我实际上卡住无法进一步移动..
用于在 xls 中下载报告的代码 m 是
<?php
include '../dbConnect.php';
$from1='2013-06-01';
$to1='2013-07-01';
$today=date('Y-m-d H:i:s');
$fileName='Outbound_download'.$today.'.xls';
ignore_user_abort(true);
set_time_limit(0);
//echo 'Testing connection handling in PHP';
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$fileName");
$flag = false;
$query="";
$query = "SELECT pendingCustomer.ackNo AS RAF, pendingCustomer.serialNo AS Serial_No, pendingCustomer.phoneNo AS Phone,pendingCustomer.repairStatus as ArrivalStatus,tblRepairQueue.repairStatus as CurrentStatus, pendingCustomer.savedAt AS UpdateRecievedAt, pendingCustomer.updated as Updated, pendingCustomer.status as Status
FROM pendingCustomer,tblRepairQueue
WHERE pendingCustomer.status!='' AND DATE(pendingCustomer.savedAt) BETWEEN '".$from1."' AND '".$to1."' and pendingCustomer.ackNo=tblRepairQueue.ackNo";
$result = mysql_query($query) or die('Error, query failed');
while($row =mysql_fetch_assoc($result)) {
if(!$flag) {
// display field/column names as first row
echo implode("\t", array_keys($row)) ."\r\n";
$flag = true;
}
echo implode("\t", array_values($row)) . "\r\n";
}
?>
我希望这个 excel 代码在后台运行。任何帮助,将不胜感激