Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
Shendemiar
Forum Contributor
Posts: 404 Joined: Thu Jan 08, 2004 8:28 am
Post
by Shendemiar » Mon Jun 18, 2007 9:19 pm
Code: Select all
SELECT * FROM `x_roope_strings` WHERE `string`='Ka_la'
Is not case sensitive. How do i match only exactly "Ka_la"?
Shendemiar
Forum Contributor
Posts: 404 Joined: Thu Jan 08, 2004 8:28 am
Post
by Shendemiar » Mon Jun 18, 2007 9:26 pm
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.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Jun 18, 2007 9:45 pm
Setting the column to BINARY would make it case sensitive.
Gente
Forum Contributor
Posts: 252 Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:
Post
by Gente » Tue Jun 19, 2007 2:59 am
Also you can use UPPER() and LOWER() functions but be attentive with character set
superdezign
DevNet Master
Posts: 4135 Joined: Sat Jan 20, 2007 11:06 pm
Post
by superdezign » Tue Jun 19, 2007 6:07 am
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.