登录我的系统时,我需要考虑区分大小写。但密码不考虑案例。
$this->db->select('user.*,userprofile.*,user.id as uid');
$this->db->from('user');
$this->db->join('userprofile', 'userprofile.id = user.id');
$this->db->like('email', $udata['email']);
$this->db->like('password', $udata["password"]);
$query = $this->db->get();
以上是我的疑问。如何更改它以使其区分大小写?
一种可能的方法是
$this->db
->select('user.*,userprofile.*,user.id as uid')
->from('user')
->join('userprofile', 'userprofile.id = user.id')
->where('email', $udata['email'])
->where('BINARY password =', $this->db->escape($udata["password"]), false)
->get();
有关更多信息,请查看here
我更改了我的变量名称以分别获取两个并在'where'中使用LIKE。
我改变了这个:
$this->db->like('password', $udata["password"]);
至
$this->db->where('password LIKE binary', $password);