Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道如何获取此语句的结果集中的行数:
$data=$db->query("SELECT name FROM users")->fetchAll();
我需要类似于mysqli_num_rows但使用medoo.
mysqli_num_rows
medoo
感谢您的帮助!
由于该query()方法返回一个数组,所以只需使用php的count()函数来确定返回的记录数(不要设置递归模式)。
query()
在文档中有一个计数方法:
$count = $database->count("users");
试试这个: 计算行数:
$count = $database->count($table, $where);