0

How can I get case sensitive from getting data in mysql? my language is php hypertext preprocessor.

I would like to get the "user1" (without qoutation):

SELECT * FROM user WHERE Username = 'user1'

This is my query but I would like to get the exact username from the database in case sensitive.

fuyushimoya
  • 9,565
  • 3
  • 26
  • 34
Marverick
  • 107
  • 9

2 Answers2

0

MySql will, by default, perform a case-insensitive search but you can use the BINARY operator to make this case sensitive.

try:-

select * from `user` where binary `Username`='user1';
Professor Abronsius
  • 30,177
  • 5
  • 29
  • 43
0

you can try as this ...

SELECT * FROM `user` WHERE BINARY  `Username` = 'user1' 
user1844933
  • 3,233
  • 2
  • 24
  • 38