codeigniter-base-model
codeigniter-base-model copied to clipboard
Case sensitivity?
Is there a way to get records with case sensitivity in mind?
If not, how would I go about adding it in?
Hi Paul,
I'm sorry, I don't think I understand. Case sensitive WHEREs on specific fields?
Jamie
On 16 April 2014 10:10, paulcanning [email protected] wrote:
Is there a way to get records with case sensitivity in mind?
If not, how would I go about adding it in?
Reply to this email directly or view it on GitHubhttps://github.com/jamierumbelow/codeigniter-base-model/issues/167 .
Jamie Rumbelow [email protected]
Yes, that's right :)
I understand that you can use "BINARY" in a WHERE statement to make it case sensitive.
I made my own function in a model using active record, but it'd be nice to have an option that can be set for a normal "get" function.
Below is my new function:
$this->db->where("BINARY column_name = '$var'", null, false); $query = $this->db->get('table_name');
return $query->row();
@paulcanning Thank you for ur function. It works!