fluentpdo icon indicating copy to clipboard operation
fluentpdo copied to clipboard

How to page using FluentPDO

Open klebinhopk opened this issue 5 years ago • 1 comments

Is it possible to create a paging function in a query with FluentPDO today?

For example: image

klebinhopk avatar Dec 05 '19 19:12 klebinhopk

There's no (as far as I know) paginate helper functions in Fluent, the way we achieve pagination is to use the offset and limit functions, which is how you'd do it when writing SQL:

// $page must be 1 or larger
$your_fluent_query->offset(($page - 1) * $page_size)->limit($page_size)->fetchAll();

adam-buckley avatar Mar 19 '20 00:03 adam-buckley