Jump to content

next page


desithugg

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
Link to comment
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.