Fetching more than 10000 rows in PHP Custom Script
Content
I am fetching a report in php which has more than 10000 rows.
While i can create a loop and get the data more the rows more than 10000 also, but I am not able to merge the all the rows.
Is there a way in PHP where we can merge the report result?
Code snippet given below.
Version
May 2015Code Snippet
$nrows=0; $mergearr=NULL; $start =0; $limit = 9999; $var=1; while($nrows>=0) { $filters= NULL; $ar= RNCPHP\AnalyticsReport::fetch(104433); //fetch(104434); $arr= $ar->run($start,$filters,$limit); $nrows= $arr->count(); if($nrows>0) { if($var==1) { $mergearr=$arr; $var=2; } else { $mergearr= array_merge($mergearr,$arr); } $start=$start+10000; } if($nrows<$limit) { $nrows=-1; } } $nrowsmer= $mergearr->count(); echo("Final rows ".$nrowsmer);
0