0

I need select result from mysql regarding query string. Let's string will be: Z and z (uppercase and lowercase)

How database look like:

url_id      test_char
1           Z
2           z

Ok, in address bar entered: localhost/z This query always selecting 1 result, first one, so it returns always 1. If i try even z.

The test_char is varchar.

How to make Z and z select diferrent results ?

OMG Ponies
  • 325,700
  • 82
  • 523
  • 502
ZeroSuf3r
  • 1,961
  • 8
  • 25
  • 36
  • 3
    What's the collation? It can be set at the table, or database levee... If the collation is _ci, that means "Case Insensitive"... – OMG Ponies Jun 04 '11 at 15:44

3 Answers3

1

MySQL uses case insensitive searching by default for non binary strings or certain collation types.

Per OMG Ponies note, you could adjust this at the DB or Table level. Alternatively, you could adjust it inline for your specific query. Examples of each are in the docs linked above.

Jason McCreary
  • 71,546
  • 23
  • 135
  • 174
0

My opinion is best use function MD5 (PHP and SQl are work)

Look a example: How to make a SELECT in PHP/MySQL case insensitive?

Sorry bad english!

Community
  • 1
  • 1
KingRider
  • 2,140
  • 25
  • 23
0

If you are using XAMPP go to localhost/phpmyadmin/ and access your database and change it to Case Sensitive.