PHP Classes

It's a good implementation, however you need to improve it.

Recommend this page to a friend!

      Simple PDO Pagination class  >  All threads  >  It's a good implementation, however...  >  (Un) Subscribe thread alerts  
Subject:It's a good implementation, however...
Summary:Package rating comment
Messages:2
Author:David Domingues
Date:2019-09-16 13:17:29
 

David Domingues rated this package as follows:

Utility: Not sure
Consistency: Not sure
Documentation: Not sure

  1. It's a good implementation, however...   Reply   Report abuse  
Picture of David Domingues David Domingues - 2019-09-16 13:17:29
It's a good implementation, however you need to improve it. You cannot write stuffs like count($this->pdo->query($this->queryString)->fetchAll(PDO::FETCH_OBJ));
You can't possibly return the entire dataset in an array and the count the elements of the array.
Make a select count(*) instead and return an integer.

Pagination is supposed to make your front end cleaner but also take weight from the database queries.

  2. Re: It's a good implementation, however...   Reply   Report abuse  
Picture of Allan Kibet Allan Kibet - 2019-09-26 09:12:00 - In reply to message 1 from David Domingues
Thank you for the feedback. I believe your query scalar approach is better. I will refactor accordingly.