CodeIgniter Forums
Pagination with GROUP CONCAT - Printable Version

+- CodeIgniter Forums (
+-- Forum: CodeIgniter 4 (
+--- Forum: CodeIgniter 4 Support (
+--- Thread: Pagination with GROUP CONCAT (/thread-76136.html)

Pagination with GROUP CONCAT - ViLar - 04-16-2020

I've been using CI4 for a month now and I'm currently facing an issue with pagination.

If I'm using it as the doc says, everything's cool. I got my pages and links. But if I want to paginate a query with a join query, a group concat and group by, my results are bad.

PHP Code:
$this->foo = new FooModel();
$data['foo'] = $this->foo
join('bar_has_foo''BAR_FOO_ID = FOO_ID''LEFT')
$data['pager'] = $this->rtiers->pager

If I dump $data['pager'], it says I have only one page with 20 results. But if I go to my view that have $data as a parameter, I can navigate to myurl?page=X without any problem.

Do you guys have any idea on how to work around this problem?

RE: Pagination with GROUP CONCAT - jhohh - 06-16-2020

This may have the same "order by" problem mentioned in system / Database / BaseBuilder.php in "function countAllResults".
you could add the same functionality that "order by" has