$db->select()
->from($tableName, array(
new Zend_Db_Expr('SQL_CALC_FOUND_ROWS id'),
'name',
'price'
));
You can also try replacing all cols with COUNT (*) and run the query a second time. It can actually be more effective (even if it runs counter to intuition). This was for my application.
You can do it as follows:
$select->reset('cols')->reset('limit')->cols('COUNT(*)');
$db->query($select);
source
share