Jump to content

PHP/MySQL multiple pages


pengu

Recommended Posts

I'll explain a bit better, I have a user database with 50 users in it for example, they're ordered by some sort of ranking.  I only want to display 10 per page.  And I'd like a ">>" next page kind of thing.  Could this be achieved by using MySQL to do a COUNT of id's or usernames (doesn't really matter)?  And then could I do use LIMIT to display the next 10 and the next 10 on the page?

 

Hopefully this makes sense.

 

id   rank
1      1
7      2
3      3
-       Page 2 >>

 

Link to comment
https://forums.phpfreaks.com/topic/166272-phpmysql-multiple-pages/
Share on other sites

use LIMIT 10; and you can use $_GET in the url for next page to find the start (www.somesite.com/somepage.php?start=1) for example

 

Can you be more specific with LIMIT is what I mean and you'd make the '10' a variable?

 

somepage.php?start=1

$start = $_GET['start'];

$sql = "BLA BLA BLA LIMIT 0, ".$start."";

 

See that kind of thing,but changing what the limits are, depending on those variables.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.