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,715
  • 3
  • 27
  • 34
Marverick
  • 117
  • 1
  • 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
  • 33,063
  • 5
  • 32
  • 46
0

you can try as this ...

SELECT * FROM `user` WHERE BINARY  `Username` = 'user1' 
user1844933
  • 3,296
  • 2
  • 25
  • 42