I have a report generation functionality. Export to csv or txt . For each month it will be 25000 records each row with 55 columns. For yearly it will be more than 300000!! i try to add memory limit ,but i dont think its good!! Anyway now its 128M.
Benim beklentim
I will split the date range selected by user into a range of 25 days or 30. I will run fetch data for 25 days , then write the csv. Then fetch next 25000 , write that . like this.
Bunu nasıl elde edebilirsiniz?
getiriliyor için bir fonksiyon kullanıyorum $result= fetchRecords();
Csv yazmak için, ben sayfayı görüntülemek ve döngü ve virgül ÖS baskı ile ayırarak, bu $ sonuç dizisi geçirerek.
Yani denetleyicisi o olacak $template->records=$result;
I for döngüsünde bunu yaparsanız
for(){
$result= fetchRecords();
$template->records=$result;
}
Ben bu çalışacaktır hink yok.
Bunun nasıl? fetch.write daha sonra yazmak getir yürütmek.
PHP bellek limt tutarak bu uygulamak için iyi bir yol önermek misiniz?