Jump to content


Photo

next page


  • Please log in to reply
1 reply to this topic

#1 desithugg

desithugg
  • Members
  • PipPipPip
  • Advanced Member
  • 281 posts
  • LocationScarborough

Posted 10 August 2006 - 11:58 PM

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


#2 Jocka

Jocka
  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationDallas, Texas

Posted 11 August 2006 - 12:07 AM

you can use something like this


$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;

}

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users