I'll try to explain this as best as possible.
I have data coming in from a MySQL database via a PHP foreach loop. It loops through 50+ records and displays data based on different variables. I want to stop the loop after say, 12 records, and then click a button to display the next 12, and so on.
Is there a way to stop, or pause a foreach loop on a certain iteration, then click a button to "play" the loop again for 12 more iterations?
Below I've posted a simplified example of this foreach loop.
foreach ($view->likeDataSet as $productData){
echo '<p class="pName">' . $productData->getPname() . '</p>';
}
This will load the name of a product I have in my database, and continue to do this until all records
Any help would be greatly appreciated, thanks!