How can you assign a binary parameter in code igniter, so that it will return a case sensitive query?
I am trying to do this
SELECT * FROM `table` WHERE BINARY `column` = 'value'
but I don't know how to. Where do I place the BINARY in my CI query.
This is my query
$query = $this->db->select('*')->from('admin')->where(array('user'=>$username, 'pass'=>$password))->get();
$temp = $this->db->last_query();
if($query->num_rows() > 0){
foreach ($query->result() as $row){
if($row->type == "1"){
$this->session->set_userdata('admin', $temp);
return "admin";
}else{
$this->session->set_userdata('manager', $temp);
return "manager";
}
}
}else{
$query = $this->db->select('id')->from('user')->where(array('user'=>$username, 'pass'=>$password))->get();
if($query->num_rows() > 0){
foreach ($query->result() as $row){
if($this->session->userdata('sessionid') == ""){
session_regenerate_id();
$this->session->set_userdata('sessionid', session_id());
}else{
$this->session->set_userdata('sessionid', session_id());
}
$session_id = $this->session->userdata('sessionid');
$this->session->set_userdata('user', $username);
return "user";
}
}else{
return "none";
}
}