I am using Active Record on CodeIgniter. I am confused on which approach I should take. Currently, our login system let\'s the user to use username/email for the login along
The issue is probably that you need to add brackets when mixing AND’s and OR’s in a WHERE clause. Try this:
$this->db->select('id,level,email,username'); $this->db->where("(email = '$user' OR username = '$user') AND password = '$pass'"); $query = $this->db->get('users');