Welcome Guest, Not a member yet? Register   Sign In
Pagination Trouble
#1

[eluser]JasonS[/eluser]
I don't understand how pagination works.

I get that the class generates the numbers to toggle between the pages but how do I get the specific results for each page?

What should my db query look like?
#2

[eluser]taewoo[/eluser]
What i do is make two queries..

1. Get 5 results associated with search, say , on page 2
Code:
"select * from table where product_type = 'blah' limit 5, 2"


2. Get total associate with search...
Code:
"select count(*) from table product_type = 'blah'"

This is how I do it. I know #2 isn't very efficient. Any one else have any suggestion?
#3

[eluser]taewoo[/eluser]
http://ellislab.com/forums/viewthread/76692/
#4

[eluser]BD-CI-Programmer[/eluser]
I am not understand pagination class and how its work. But i have a good solution. Please go to http://www.phpclasses.org and find a pagination class. Now Integrate that class on your libraries.




Theme © iAndrew 2016 - Forum software by © MyBB