Link to home
Start Free TrialLog in
Avatar of jset_expert
jset_expertFlag for Australia

asked on

PHP MSSQL DB Like statments are case sensitive

Hi,

I have developed a simple SQL search system that uses LIKE "%a%" conditions

The search works fine on my dev platform, (Win XP / PHP / Apache / SQL 2005)

But on the clients platform (Win Server 2003 / PHP / Apache / SQL 2000) the search is case sensitive

Can any help me as to why this might be?

ASKER CERTIFIED SOLUTION
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jset_expert

ASKER

I'm pretty sure the database collation is Latin_General_BIN

I see if I can change the collation, if not I will incorporate the UPPER or LOWER functions


It's not the collation, but a setting within the collation settings page.  That sounded better in my head.  IIRC, it is one of the options available when you select binary comparison.
Changing the database collation is fairly painful for existing data, but easy for new data.

http://support.microsoft.com/kb/325335

When using upper() or lower() ensure you use it on both sides.