PHP/MySQL Pagination

SELECT col FROM table LIMIT 0,5; — First page, rows 1-5 SELECT col FROM table LIMIT 5,5; — Second page, rows 6-10 SELECT col FROM table LIMIT 10,5; — Third page, rows 11-15 Read the LIMIT section on the MySQL SELECT helppage. If you want to display the total number of rows available, you can … Read more

Limiting a doctrine query with a fetch-joined collection?

Paginate was merged with doctrine 2.2 And the new symfony2 release 2.0.10 is compatible with. Now use it like that //use Doctrine paginator use Doctrine\ORM\Tools\Pagination\Paginator; Write your query then call results like that. $query->setMaxResults($limit); $query->setFirstResult($offset); $results = new Paginator($query, $fetchJoin = true); Hope this will help you. Note: If you are using SF2 2.0.10, you … Read more