0
我在CI模式简单的代码登录,但它始终返回0NUM_ROWS返回零所有的时间笨
$this->db->select('*');
$this->db->from('cms_users');
$this->db->where('username', "admin");
$this->db->where('password', "admin01");
$query = $this->db->get();
echo $query->num_rows();exit;
它总是打印0
当我尝试echo $this->db->get_compiled_select();exit;
并运行phpmyadmin它返回一个值。
你在你的数据库检查你确实有一个用户= '管理员',密码= 'admin01'在你的表cms_users中? – Bak
其实你不需要$ this-> db-> select('*');但是使用$ this-> db-> get()默认是这样做的 – Bak