用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1314|回复: 2
收起左侧

[HELP] $query->num_rows() == 1 的问题。

[复制链接]
发表于 2014-11-27 15:42:54 | 显示全部楼层 |阅读模式
$this->db->query("select * from table where 1 = 2");
echo $query->num_rows();

显示结果为 1. 不是应该为 0 吗?
 楼主| 发表于 2014-11-27 15:46:02 | 显示全部楼层
额,不好意思,这个是对的。
但是下边这个错了。

$this->db->query("select max(id) from table where 1 = 2");
echo $query->num_rows();
 楼主| 发表于 2014-11-27 15:49:16 | 显示全部楼层
echo($this->db->query("select * from characterpowers where 1=2")->num_rows());   
//这个对的,显示0


echo($this->db->query("select max(powerid) from characterpowers where 1=2")->num_rows());
//这个错了,显示1

本版积分规则