Hello all,
So i want to make a user list.. (i know how to make this)
but i want it to be more pages, so 20 users to page, how exactly do i do that? because i've never done that before =p
Thanks for the help =D
user list
user list
Current project: http://www.mmtycoon.eu
Re: user list
It`s called pagination. The idea is that if the limit is 20, you only query 1 to 20 for the first page, if you go to the next page, you pass a parameter ( the pagination number ) that measures the offset.
So pagination number 1 is: 1 * 20 for the first, 1 * 20 + 20. 20 - 40
So pagination number 2 is: 2 * 20 for the first, 2 * 20 + 20. 40 - 60
So pagination number 3 is: 3 * 20 for the first, 3 * 20 + 20. 60 - 80
You can limit your query`s using the LIMIT keyword. Like "SELECT username, score FROM users LIMIT 20, $offset".
So pagination number 1 is: 1 * 20 for the first, 1 * 20 + 20. 20 - 40
So pagination number 2 is: 2 * 20 for the first, 2 * 20 + 20. 40 - 60
So pagination number 3 is: 3 * 20 for the first, 3 * 20 + 20. 60 - 80
You can limit your query`s using the LIMIT keyword. Like "SELECT username, score FROM users LIMIT 20, $offset".