craigtolputt Posted April 24, 2009 Share Posted April 24, 2009 Hi Guys, I have a news system where the admin can add/edit and delete news items. I really need to find out how to display only 4 news items per page and then have a next and prev links to display the next 4 on a different page and so on. does anyone know how to do this please? Quote Link to comment https://forums.phpfreaks.com/topic/155488-displaying-only-4-records-from-a-db-and-having-a-next-and-prev-buttons/ Share on other sites More sharing options...
Potatis Posted April 24, 2009 Share Posted April 24, 2009 Yes, you need to search for a "pagination" script and give it a try. If you can't get it to work, you can ask for help with any specific problems you have. I could give you a pagination script, but when I researched this myself, I found I could do it myself, and I learnt a lot. Sorry for being no help. Quote Link to comment https://forums.phpfreaks.com/topic/155488-displaying-only-4-records-from-a-db-and-having-a-next-and-prev-buttons/#findComment-818174 Share on other sites More sharing options...
craigtolputt Posted April 24, 2009 Author Share Posted April 24, 2009 nice one thanks, Ive done a search and found a good one. Its easy when you know the terminology but im a newbie so please bare with me... i tried this first but cant figure the damn thing out http://www.onlamp.com/pub/a/php/2000/11/02/next_previous.html Quote Link to comment https://forums.phpfreaks.com/topic/155488-displaying-only-4-records-from-a-db-and-having-a-next-and-prev-buttons/#findComment-818175 Share on other sites More sharing options...
Potatis Posted April 24, 2009 Share Posted April 24, 2009 Good start. If you keep searching you can find good tutorials where they'll explain each bit of code one step at a time, so you will understand it. You'll be able to style the page numbers nicely too with CSS to look like some major websites such as digg.com etc. Quote Link to comment https://forums.phpfreaks.com/topic/155488-displaying-only-4-records-from-a-db-and-having-a-next-and-prev-buttons/#findComment-818177 Share on other sites More sharing options...
craigtolputt Posted April 24, 2009 Author Share Posted April 24, 2009 I think this isnt what i was looking for as it requires me to seperate the large content into divs. i need to dynamically get the number of records from a database then only display 4 per page and have dynamic links made according to the number or total records it needs to display. Quote Link to comment https://forums.phpfreaks.com/topic/155488-displaying-only-4-records-from-a-db-and-having-a-next-and-prev-buttons/#findComment-818179 Share on other sites More sharing options...
Potatis Posted April 24, 2009 Share Posted April 24, 2009 Yes, that's pagination. Quote Link to comment https://forums.phpfreaks.com/topic/155488-displaying-only-4-records-from-a-db-and-having-a-next-and-prev-buttons/#findComment-818184 Share on other sites More sharing options...
premiso Posted April 24, 2009 Share Posted April 24, 2009 Basic Pagination on PHPFreaks PHPFreaks has a great pagination tutorial written by CV. If that is what you are after take a look at that tutorial. Quote Link to comment https://forums.phpfreaks.com/topic/155488-displaying-only-4-records-from-a-db-and-having-a-next-and-prev-buttons/#findComment-818291 Share on other sites More sharing options...
craigtolputt Posted April 24, 2009 Author Share Posted April 24, 2009 cheers guys will take a look, ive been trying some found on the net but none seemt to work. : ) Quote Link to comment https://forums.phpfreaks.com/topic/155488-displaying-only-4-records-from-a-db-and-having-a-next-and-prev-buttons/#findComment-818309 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.