CodeIgniter Forums
CI 4 pagination - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: CI 4 pagination (/thread-75137.html)



CI 4 pagination - Masood - 12-29-2019

From past few days I have started working in CI4, I would like to know how pagination works with below query?

1. $query = $this->db->query("select * from users");
$result =  $query->getResultArray();

Using model is working as expected find below query
2. $data = [
            'users' => $this->users->where('active', '1')->paginate(4),
            'pager' => $this->users->pager
        ];

But facing issue with above 1st query result set. Could you please help me out to resolve this issue

Thank you in advance.