Gossamer Forum
Home : General : Databases and SQL :

Case sensativity with LIKE...

Quote Reply
Case sensativity with LIKE...
I've been looking into case sensativity in MySQL's LIKE function. The closest I have found is this;

mysql> SELECT BINARY "a" = "A";

I can't really comprahend how this is supposed to make a LIKe statement case sensative though. Is there such a thing as case sensativity in a LIKE statement? I just can't seem to find anything related to it in the sense that I need.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Case sensativity with LIKE... In reply to
SELECT * FROM Table WHERE Password LIKE BINARY '%foo%'

For columns storing passwords etc it's best to make the column binary rather than including binary in the query.
Quote Reply
Re: [Paul] Case sensativity with LIKE... In reply to
Wow....never knew it was that simple Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!