gpt4 book ai didi

mysql - Zend_Db : How to get the number of rows from a table?

转载 作者:IT老高 更新时间:2023-10-29 00:13:01 27 4
gpt4 key购买 nike

我想知道一个表中有多少行。我使用的数据库是 MySQL 数据库。我已经有一个 Db_Table 类,用于像 fetchAll() 这样的调用。但我不需要表格中的任何信息,只需要行数。如何在不调用 fetchAll() 的情况下获取表中所有行的计数?

最佳答案

$count = $db->fetchOne( 'SELECT COUNT(*) AS count FROM yourTable' );

关于mysql - Zend_Db : How to get the number of rows from a table?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1930723/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com