Jump to content

Recommended Posts

hi, i have like 93 entries on a database table, divided to show 20 per page, but i wanted to display something like "showing results 1 to 20" on each page, and on the last page, it would display "showing results 81 to 93".

to get the first number, i use the same variable that i use to define where the page starts, but i dont know how to get the last entry that is being displayed. any clues?

thanks in advance!

Coming up with the to x value is rather straight-forward, simply take the starting number and add the mysql_num_rows() value to it.

 

On full pages, where you queried for 20 results, mysql_num_rows() will be 20. On the last page, mysql_num_rows() will be just the number that was actually retrieved.

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.