<?=$this->db->count_all_results('users')?>
嗨,我被卡住了。如何运行如下计数的查询并回显所有返回的行?我目前正在使用上述语句,但我需要此改进。
<?php $aa = $this->db->query("SELECT * FROM users WHERE itemNumber = 1");
最佳答案
使用 num_rows() 方法
<?php
$aa = $this->db->query("SELECT * FROM users WHERE itemNumber = 1");
echo $aa->num_rows();
?>
关于php - Codeigniter 运行 mysql 查询并回显返回行数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13852846/