how to limit number of pages

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
red wolf
Forum Newbie
Posts: 11
Joined: Sun Feb 19, 2012 4:38 am

how to limit number of pages

Post by red wolf »

I have 20 articles in my database.
i want the file view_article.php will show me all the 20 articles but if there is more than (for example 10 articles) its needed
to open me a new page under this articles to show others.
how can i do it please?
phphelpme
Forum Contributor
Posts: 261
Joined: Sun Nov 21, 2010 3:32 pm

Re: how to limit number of pages

Post by phphelpme »

Sounds to me like you are after some type of pagination that allows to count the values or extracts 10 records at a time and calculates the total pages required for 10 articles per page, the show page numbers, when page number is clicked it would show those articles that would fall into that page id.

Here are a few examples:

http://www.phpfreaks.com/tutorial/basic-pagination

http://phpeasystep.com/phptu/29.html

http://php.about.com/od/phpwithmysql/ss ... nation.htm

If I am wrong and this is not what you are after then let me know with a little more detail.

Best wishes
Post Reply