Note that there are some explanatory texts on larger screens.

plurals
  1. POPHPExcel Timeout occur
    text
    copied!<p>Please help me for the the problem exporting large data to excel format xlsx. i m exporting almost 45000 records at a time to single file and it timeout without saving file. the mysql select query is taking 21 seconds for executing that large data. Below is my code to export data in to Excel file using PHP Excel library. </p> <pre><code> $sql2 = "SELECT * FROM Surveys"; $result2 = mysql_query($sql2); while($row2 = mysql_fetch_assoc($result2)) { $j=$rowscounter+2; $sheet-&gt;setCellValue("A$j",$row2['brandname']); $sheet-&gt;setCellValue("B$j",$row2['productname']); $sheet-&gt;setCellValue("C$j",$row2['sname']); $sheet-&gt;setCellValue("D$j",$row2['smobile']); $sheet-&gt;setCellValue("E$j",$row2['semail']); $sheet-&gt;setCellValue("F$j",$row2['country']); $sheet-&gt;setCellValue("G$j",$row2['city']); $sheet-&gt;setCellValue("H$j",$row2['sdob']); $sheet-&gt;setCellValue("I$j",$row2['age']); $sheet-&gt;setCellValue("J$j",$row2['comment']); $sheet-&gt;setCellValue("K$j",$row2['outletcode']); $sheet-&gt;setCellValue("L$j",$row2['username']); $sheet-&gt;setCellValue("M$j",$row2['datetime']); $sheet-&gt;setCellValue("N$j",$row2['duration']); $rowscounter++; } // Rename worksheet $sheet-&gt;setTitle('Survey-Report'); $objPHPExcel-&gt;setActiveSheetIndex(0); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); $objWriter-&gt;setPreCalculateFormulas(false); unlink("Survey-Report.xlsx"); $objWriter-&gt;save('Survey-Report.xlsx'); echo "ok"; </code></pre> <p><B>UPDATE:</B></p> <p>I forgot to mention that I already tried set_timout etc and wrote below code in my php file.</p> <pre><code>set_time_limit(0); ini_set('memory_limit','2500M'); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload