Welcome Guest, Not a member yet? Register   Sign In
why Codeigniter database query is case-insensitive?
#1

(This post was last modified: 04-13-2019, 06:08 AM by squashking.)

Hi guys,

I want database query to be case sensitive. I have set the table Collation to be "utf8_bin", which is supposed to be case sensitive. However, when I ran the following query code:
$this->db->where('code', $code);
$this->db->select('*');
$query=$this->db->get('my_table');
return $query->row();

I found that the query was not case-sensitive. For example, my_table has a row where code="abc" but no row with code="Abc". However, if I use $code="Abc" and do the query,  which is expected to return null, but it actually returns the row where code="abc".

So, any ideas how I can make the query case-sensitive? BTW, I am using Codeignitr 3.X

Thank you!
Reply


Messages In This Thread
why Codeigniter database query is case-insensitive? - by squashking - 04-13-2019, 06:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB