热搜:NVER 

Zend_Db_Table返回查询记录集有关问题

2024-05-18 15:24:01
 Zend_Db_Table返回查询记录集有关问题

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);