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 ?
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.