Zend framework paginator distinct
If I have a query like:
SELECT DISTINCT unnest(test) AS "test" FROM table ORDER BY "onderwerp" ASC LIMIT 10
The amount of pages is never right as it will add another query:
SELECT COUNT(1) AS "zend_paginator_row_count" F开发者_StackOverflow社区ROM table
What is the best way to get the right amount of pages with a distinct query?
From http://framework.zend.com/manual/en/zend.paginator.usage.html (the The DbSelect and DbTableSelect adapter section), you can specify the query to use to get the count.
$adapter->setRowCount(<a new query to get just the count>);
精彩评论