我想在 Codeigniter 中使用以下查询:
SELECT `users` . * , `users_profile` . * FROM (`users`) LEFT JOIN `users_profile`
ON `users`.`id` = `users_profile`.`users_id`
WHERE (`loginid` = '$username' OR `email` = '$username' )
AND `password` = '$password' AND `users`.`status` = 'A' LIMIT 1
它工作正常,但是当我以 Codeigniter 格式编写此查询时:
$this->db->where('loginid',"$username");
$this->db->or_where('email', "$username");
$this->db->where('password',MD5($password));
$this->db->where('users.status','A');
$this->db->limit(1);
它将始终返回 true 什么是正确的语法?