Page 1 of 1

String case question

Posted: Mon Jun 18, 2007 9:19 pm
by Shendemiar

Code: Select all

SELECT * FROM `x_roope_strings` WHERE `string`='Ka_la'
Is not case sensitive. How do i match only exactly "Ka_la"?

Posted: Mon Jun 18, 2007 9:26 pm
by Shendemiar
Not sure what it means, but i "altered my table structure to have the strings to have case sensitive collation".

Now it works the way i want to.

Posted: Mon Jun 18, 2007 9:45 pm
by feyd
Setting the column to BINARY would make it case sensitive.

Posted: Tue Jun 19, 2007 2:59 am
by Gente
Also you can use UPPER() and LOWER() functions but be attentive with character set

Posted: Tue Jun 19, 2007 6:07 am
by superdezign
feyd wrote:Setting the column to BINARY would make it case sensitive.
You can also just use the BINARY keyword in the query. I use it on logins so that no user can sign up with the same name having different cases, but they have to login with the same case that they signed up with.