mareimorsy / DB

Simple PHP Query Builder class
106 stars 76 forks source link

Pagination is starting from first to last #3

Closed iahmedhendi closed 7 years ago

iahmedhendi commented 7 years ago

all pagination systems depend on getting last group of items then go to the old one but your class do the opposite please fix. Thanks

mareimorsy commented 7 years ago

Dear MareiDB user, Getting the result set in ascending order is just the default behavior, and it has nothing to do with pagination. You can use orderBy() method just right before paginate() to order the result set in a descending order by a column name as it's shown in the following link : https://github.com/mareimorsy/DB#order-the-result-set and also, here is a tutorial of how to do that : https://www.youtube.com/watch?v=1GbWpC9dSas&list=PLyI730B8iC9X0x361y6R3LIJa6TDqfqS0&index=11