We help IT Professionals succeed at work.

PHP MSSQL DB Like statments are case sensitive

jset_expert
jset_expert asked
on
256 Views
Last Modified: 2013-12-12
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?

Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2004
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
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


CERTIFIED EXPERT
Top Expert 2004

Commented:
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.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.