|
|
 |
Re: FN-FORUM: MySQL CAse Sensitive
date posted 3rd August 2005 23:46
> Have a MySQL query issue - I have a site that requires users to enter
> their surname to validate a login, The data stored in the database could
> be in any case, i.e. SMITH, smith or Smith - Is there a way of getting
> the query so search the surname field ignoring case? I've Googled but
> not sure I'm search the right term.
Text comparisons in MySQL are case-insensitive by default, so "WHERE name
LIKE 'smith'" or "WHERE name = 'smith'" will do what you want out of the
box. If you want to force a case-sensitive comparison you have to use the
BINARY operator. There's probably also some clever locale-aware stuff too,
for accented character comparisons...
Cheers!
Anthony
--
www.fonant.com - hand-crafted web sites
|
 |
|