Search code examples
databasecodeignitercasecase-sensitive

Codeigniter database make case sensitive


I need to consider case sensitivity when login to my system. But password do not consider case.

    $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();

The above is my query. How can I change it so that its case sensitive?


Solution

  • I changes my variables names to get the two separately and used LIKE inside 'where'.

    I changes this :

    $this->db->like('password', $udata["password"]);
    

    to

    $this->db->where('password LIKE binary', $password);