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!
how to show fetch array number of results?
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: how to show fetch array number of results?
Search this forum for 'pagination'. There are many threads with great examples.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: how to show fetch array number of results?
thanks, but my pagination is done, i just need to retrieve this number
Re: how to show fetch array number of results?
If you're doing the pagination with a LIMIT clause in your SQL query, you're going to have to do a separate query first to get the number of rows. You can do that by using mysql_num_rows($result).