zhj11226 发表于 2014-11-27 15:42:54

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

$this->db->query("select * from table where 1 = 2");
echo $query->num_rows();

显示结果为 1. 不是应该为 0 吗?

zhj11226 发表于 2014-11-27 15:46:02

额,不好意思,这个是对的。
但是下边这个错了。

$this->db->query("select max(id) from table where 1 = 2");
echo $query->num_rows();

zhj11226 发表于 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
页: [1]
查看完整版本: $query->num_rows() == 1 的问题。