Jump to content

Archived

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

desithugg

next page

Recommended Posts

umm heres what i ahve i use a query to show my members list and i have a limit of 15 on a page but for the next page i use $start and 15 and increases by 15 each time u click next page but is there a way i can make it so it counts how many members there are any show that many page links
like instead of
Next page which leads to next 15
i want it to show
1 2 3 4 5 6 7 8 9 10 and so on

Share this post


Link to post
Share on other sites
you can use something like this

[code]

$count = 15; // number of rows on a page

$result = mysql_query("SELECT * FROM table1", $link);
$num_rows = mysql_num_rows($result);

$math = $num_rows / $count;

$links = '';
$page_count = 15;

for($i = 1; $i <= $math; $i++){
 
  $links .= "<a href='thispage.php?page=" . $page_count . "'>" . $i . "</a>";

  $page_count = $page_count + 15;

}
[/code]

You echo $links when it's done and there that goes.. I'm not sure how you have everything set up so I just threw a few things together there.

something like that should work

Share this post


Link to post
Share on other sites

×

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.