Zend_Db_Table返回查询记录集有关问题
时间:2021-07-01 10:21:17
帮助过:7人阅读
Zend_Db_Table返回查询记录集问题
$dbTable = new Zend_Db_Table('client_info');
$select = $dbTable->select()
->from('client_info');
return count($dbTable->fetchAll($select)->toArray());
代码如上,当client_info表里的数据达到十万条以上时就无法查询到记录条数,求各位大虾指教!小弟刚上路,先谢谢各位了
------解决方案--------------------
$dbTable = new Zend_Db_Table('client_info');
$select = $dbTable->select()
->from('client_info', 'count(*)');
return $dbTable->getAdapter()->fetchOne($select);