Mememe Posted December 1, 2007 Share Posted December 1, 2007 Well, I'm not sure how to go about doing this.How would I have it so, after a certain number of posts are displayed, it the next set of posts are showed on another page. For example, if the maximum number of posts for one page is 5, and there were 15 posts in all, there would be a file called "view.php?page=1"And that would show the first 5 posts (meaning first 5 rows from the table in the database). Then when someone clicks on a link that goes to view.php?page=2", it would show the next 5 posts. And there would be another link, linking to view.php?page=3. That link would show the last 5 posts. And so on.Thanks, Mememe. Link to comment Share on other sites More sharing options...
justsomeguy Posted December 3, 2007 Share Posted December 3, 2007 Do a search for pagination, that question has been addressed several times. Link to comment Share on other sites More sharing options...
Mememe Posted December 4, 2007 Author Share Posted December 4, 2007 I idea I had was first find the amount of pages. Then for every encode the page number into the url. The problem is that how would I select 5 rows, for page 2?So, for page 1, I would select the rows 1-5. Then for page 2, I would need to select rows 6-10. How would I do that? Link to comment Share on other sites More sharing options...
Synook Posted December 4, 2007 Share Posted December 4, 2007 Page 1: SELECT * FROM table LIMIT 5 Page 2: SELECT * FROM table LIMIT 5,5 Link to comment Share on other sites More sharing options...
astralaaron Posted December 6, 2007 Share Posted December 6, 2007 if you find an easy way to do it let me know Link to comment Share on other sites More sharing options...
Mememe Posted December 7, 2007 Author Share Posted December 7, 2007 So page 3 would be LIMIT 5,10 ? Link to comment Share on other sites More sharing options...
Synook Posted December 7, 2007 Share Posted December 7, 2007 Other way round - LIMIT 10, 5 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.