$result = $database->loadRowList(); foreach($result as $row) { $count++; if($count > 10000) { break; } .... }
An array of 20,000 e, you must first go through 10,000 e of the array, then again go through but the next 10,000, how do I get to the beginning of the next 10 thousand?
Update
It is necessary to find in the database duplicates of the article, and calculate if there is any info in any of the duplicate groups, if there is one, copy it to another table.
With a query, I return all duplicates to the database, then the simple scheme At the 1st stage, I expand the duplicates in one array in which there is information and another array without information, then copy the information from one array to another, then again, I check if there is a table an existing record with an ID duplicate that I want to write, if not, I delete this duplicate from the array, but at the end I write down what remains in the table. At the stage when I compare the array with the table in the database, all this does not fit into the session, I wanted to break it into stages