So the way I see zend paginate work is that you do:
$paginator = Zend_Paginator::factory($results);
$paginator->setItemCountPerPage($itemCount);
$paginator->setPageRange($pageRange);
Where $results is the result of loading a bunch of items from a database in the form of
"SELECT * FROM table WHERE etc"
Then zend paginate will count the number of results and generate the page ranges automatically...
But if you do this then you're going to have to fetch all results of a database which I see as a waste since only one page is displayed at a time and therefore you only need to fetch the items for that page...
how do you make zend paginate to be able to calculate the correct page ranges and numbers without resorting to fetching all the results of an entire table?