Bottyz Posted October 13, 2011 Share Posted October 13, 2011 Hi all, I have a database which contains customer details. We have a php script which pulls the records from the database and puts them into a table on the page. Currently, it fetches all the customer records. This wasn't such a problem when there was only a few customers in the db but this is a bit higher now! Is there any way I can modify the script to only show 20 per page and add links to page 2 etc along the bottom, which can be clicked to show the next 20 and so on? I can post my current code if need be, Thanks. Quote Link to comment Share on other sites More sharing options...
trq Posted October 13, 2011 Share Posted October 13, 2011 http://www.phpfreaks.com/tutorial/basic-pagination Quote Link to comment Share on other sites More sharing options...
Bottyz Posted October 13, 2011 Author Share Posted October 13, 2011 http://www.phpfreaks.com/tutorial/basic-pagination Awesome! I never thought to look in the tutorials, sorry! One other thing though, if wanted to also have the ability to pull 10 rows of customers into a page based on the first letter of their name, and still have the page 1, 2, 3 etc... could you point me in the right driection on how to do that? Thanks. Quote Link to comment Share on other sites More sharing options...
trq Posted October 13, 2011 Share Posted October 13, 2011 Just use an ORDER BY clause in your query. Quote Link to comment 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.