Download reports in the background

Actually, I have a file in which the download takes place in xl .., but the table contains huge entries, and it takes more than 2 minutes. So I want to run this file in the background, and when the download is finished, it pops up in front that the download is finished ... and so it can go and check the download folder .. so that it can continue to perform other tasks while the download is in progress on the back ... without forcing him to wait .. and googled several sites, but could not exit. my download code

$fileName = 'Enquires.xls' ;
header("Content-type: application/vnd.ms-excel"); 
header("Content-Disposition: attachment; filename=$fileName");
$flag = false;
$query="";
$query  = "Select ackNo as AckNo, serialNo as SerialNo ,DATE(time) as EnquiryTime, product as Product , customerName as CustomerName , phone as Phone ,query as CustomerQuery,tech as CSO ,raf as RAF_Status,eng_comments as EngineerComments from customerEnquiry where ackNo like '".$locationprefix."%' and DATE(time) between '".$from."' and '".$to."'";

$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";
  }
+3
source share
2 answers

, , , . , , , cron, , . javascript, 30 , , . , .

0

, . . - Redis, Gearman, . . .

0

All Articles