Membership
Main Menu
Forum Boards
Stats
- 18 tutorials
- 72,311 members
- 696,197 forum posts
- 11 blog posts
Tutorials
PHP Basic Pagination
by Crayon Violent on Jun 18, 2008 6:11:55 PM
Views: 45430
Since we have our list of 106 rows, and we want to only grab 10 specific rows of our target page, we need to find the "offset." That is, for example, page 8 is not going to start at the top of the list. It's going to start on row 80. Actually, it's going to start on row 70, since computers like to start counting at zero, not one. So we take our current page (let's say page 8), subtract 1 from it, and then multiply by our rows per page (10). Again, computers start at zero, so:
page 1 of our list will be rows 0-9.
page 2 of our list will be rows 10-19.
etc...
Comments
1. Ben Smithers on Jun 19, 2008 8:47:14 AM
2. Rezert on Jun 20, 2008 8:48:44 AM
3. Crayon Violent on Jun 20, 2008 10:35:51 AM
4. Rodney Moore on Jun 20, 2008 3:45:30 PM
5. Rezert on Jun 20, 2008 7:38:02 PM
6. norwid on Jun 22, 2008 1:50:14 PM
7. Crayon Violent on Jun 22, 2008 4:48:14 PM
8. Christopher Burnside on Jun 24, 2008 7:07:35 AM
9. webent on Jul 3, 2008 4:08:16 PM
10. petitchevalroux on Aug 1, 2008 8:02:26 AM
11. vherhonne on Aug 2, 2008 12:40:41 PM
12. GreenUser on Aug 15, 2008 3:19:29 PM
13. tmallen on Sep 1, 2008 8:50:48 PM
14. Fluoresce on Sep 16, 2008 3:36:32 PM
15. Crayon Violent on Sep 17, 2008 5:34:48 PM
16. biciodark on Oct 14, 2008 8:20:25 PM
17. hakmir on Oct 16, 2008 5:52:14 PM
18. Crayon Violent on Oct 16, 2008 6:28:17 PM
19. Kayosz on Oct 27, 2008 10:19:05 AM
20. Crayon Violent on Oct 27, 2008 11:02:34 AM
21. yepwingtim on Oct 31, 2008 7:35:49 PM
22. yepwingtim on Nov 1, 2008 3:15:23 AM
23. Crayon Violent on Nov 2, 2008 1:37:43 AM
Login or register to post a comment.
