Use the pagination algorithm
**Before doing so, use COUNT() the first query to count all records. Only use this to get the numbers for preparation only for your algorithm. Only used to calculate TOTAL pages.
**Second query, Use LIMIT query at the end.
if you got 20 records per page. Create an algorithm to do this.
Page 1 --> LIMIT 0, 20;
Page 2 --> LIMIT 20, 20;
Page 3 --> LIMIT 40, 20;
Page 4 --> LIMIT 60, 20;
Page 5 --> LIMIT 80, 20;
and so forth..... 20 records interval until to the LAST PAGE calculated.
Code:
$interval = ($input-1) *20;
To solve for page 1: answer is 0
To solve for page 5: answer is 80
To put it simply.... you should make your queries dynamic too, not only the result. Are you using PHPMYADMIN? You should see that coming, the BIG EXAMPLE is just under your nose. You're clicking "next pages" with that application, you could see PHPMYADMIN handle it!!!
rock on dude!!!