9Feb/1017
PHP Tutorials: Pagination (Part 2)
Visit the forum for help! phpacademy.info Follow on Twitter! twitter.com Paginating results from a mysql database. This is a (almost) simple method of showing paginated results effectively.
Visit the forum for help! phpacademy.info Follow on Twitter! twitter.com Paginating results from a mysql database. This is a (almost) simple method of showing paginated results effectively.
August 24th, 2009 - 19:40
omg omg omg!!!11
August 24th, 2009 - 20:17
Is it possible to limit the number of link ? to 10 for an example?
Prev 1 2 3 4 5 6 7 8 9 10 next
If you’re on page 11
Prev 11 12 13 14… 21 next
August 24th, 2009 - 22:59
Hi, Alex. Wow, you made that very easy. Mind was very messy and complicated. Do you like the idea of OOP PHP? Just wondering. xD
August 25th, 2009 - 01:21
awesome tutorial alex!!!
August 25th, 2009 - 06:07
5 star again!!!
August 25th, 2009 - 11:08
Thanks for the tutorial. It’s useful for my webpage now, especially on the news section.
August 25th, 2009 - 13:01
best php teacher on the internet!
August 26th, 2009 - 13:33
I totally agree. I love they way he explains each part of the code so well. I learned most of the php from him and next semester I’m doing php so ill be like pro at it thanks to you tho.. = )
August 27th, 2009 - 18:12
I Love Your Forum
August 31st, 2009 - 06:29
Alex your a true god! Any chance of merging search engine with pagination? ive tried fiddling with it but nothing is working, thank you
October 19th, 2009 - 00:56
thanks for sharing Alex.
October 20th, 2009 - 12:31
Works good unless users changes the url start-variable by themself.
The best way of doing it is actually by having a page-variable instead of start, then if users changes it to 2 it would still show page 2, mysql rows 5-9. If a user changes the start-variable to 2, as the navigation works now, it would show mysql row 2-6.
But why would users do that
Thanks for another great tutorial!! Looking forward to part 3!!
November 7th, 2009 - 23:51
Great tutorial, and I think what you were looking for at ~3:40 was 0,4 5,9 etc.
November 21st, 2009 - 06:20
Thank you this video was perfect. Keep up with the videos.
December 10th, 2009 - 09:42
I found these EXTREMELY useful, thank you so much! One question though:
If there are fewer records returned than the maximum amount we want to display per page, is there an easy way of hiding the ‘1′? The ‘next’ link doesn’t show up, which is good, but there’s still that ‘1′ sitting there.
Thanks
Liam
December 10th, 2009 - 12:28
I learned more from you than watching that Lynda tutorial because you explain each step clearly and show us what happens if we mess up or if there is something lacking in our code. You are indeed a great teacher. Keep it up!
January 11th, 2010 - 06:06
@iamtheboat Put
if($record_count > $per_page);
{
directly after the //show page numbers comment.
Then put a } directly before the //show next button comment.