[eluser]Colin Williams[/eluser]
[quote author="fiktionvt" date="1258505742"]I think my first post was unclear. I am trying to use pagination but instead of paginating an entire table in my database, I want to paginate over a custom query resultset. So for example if my query was
Code:
SELECT * first_name, last_name, userID FROM users;
I would like to paginate over that result set on my view. I have read a lot about the pagination class and have tried all day to get it to work but I am just not understanding. Can someone show me some sample code on how this might be achieved? Thanks[/quote]
Your query needs a limit and offset. Offset will initially be 0, and $perpage should always be the same. These will be the same values you use for your pagination config.
Code:
SELECT * first_name, last_name, userID FROM users LIMIT $offset, $perpage;