Page 1 of 1

select but distinct sensitive words

Posted: Sat Jul 01, 2006 5:15 am
by duk
hy guys...

i need some help, what i need to know is if its possible, for exemple you got 100 records all with lower and upper case characters then the user inputs a information, you want to check if there is someone with that name already, but i want to check lower and uper case letters with mysql is possible ???

thanks in advance

Posted: Sun Jul 02, 2006 10:28 am
by RobertGonzalez
You can use the LCASE() (or LOWER()) and UCASE() (or UPPER()) functions. Information can be found in the MySQL manual on String Functions.

Posted: Tue Jul 04, 2006 9:34 pm
by printf
If the names have mixed case AbCdE, then you can use a regex! If you don't want to use the regex engine, then just cast the field you are matching to BINARY, then your match will be truly case sensitive.

Example...


Code: Select all

// will only match (Dart) within the field, no other combinations of (dart) will match

SELECT city FROM `usa` WHERE BINARY city LIKE '%Dart%';

// will only match (Dartmouth), no other combinations of (dartmouth), will match

SELECT city FROM `usa` WHERE BINARY city = 'Dartmouth';
pif