Page 1 of 1

how to limit number of pages

Posted: Wed Mar 28, 2012 7:04 pm
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?

Re: how to limit number of pages

Posted: Wed Mar 28, 2012 8:43 pm
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