IPhone Cases - Wordpress Theme - Find jobs - Properties in Dubai - Debt Consolidation

PDA

View Full Version : how to generate pages dynamically


rafiqasad
Jan 2nd 2007, 10:50 pm
i have a comments page on my site where comments posted by the users are displayed. I want to know that is it possible that as the comments are increasing the pages created automatically. Mean if there are 10 comment then that are displayed on a page. If there are 20 comments then first 10 are displayed on one page and ohter on the next page and so on as this is the pure example of FORUMS please guide me

streety
Jan 3rd 2007, 5:09 am
How are you storing your comments? If it is in a database you can just use LIMIT to select the first 10 comments on the first page and then the next 10 on the next page.

KC TAN
Jan 3rd 2007, 6:45 am
Check out offset and limit in sql if you are storing the data in db as stated by streety.

audax
Jan 3rd 2007, 2:18 pm
Search Google for PHP Pagination. There are some great tutorials on how to limit MySQL results - that is, if your comments are stored in a MySQL DB.

Try this for starters:
http://www.phpfreaks.com/tutorials/43/0.php