Home  >  Article  >  Backend Development  >  Zend_Db_Table返回查询记录集有关问题

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

WBOY
WBOYOriginal
2016-06-13 09:59:13761browse

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn