php process - one after another - simulating threading

UgarewDixson

New Member
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.My expectationI 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.How can I attain this?for fetching am using a function \[code\]$result= fetchRecords();\[/code\]For writing csv , I am passing this $result array to view page and by looping and seperating by comma am printing.So in controller it will be \[code\]$template->records=$result;\[/code\]If i do this in a for loop\[code\]for(){ $result= fetchRecords(); $template->records=$result;}\[/code\]I dont hink this will work.How to do this? execute fetch.write then fetch then write.Can you please suggest better way to implement this in PHP keeping it in memory limt?
 
Back
Top