I created a database without defining the char set so it defaulted to Latin. Now I need to make a case sensitive search so I used the command:
$sql = "SELECT * FROM Users WHERE username = '$value' COLLATE SQL_Latin1_General_CP1_CS_AS";
The problem is that it returns no matches.
In my web page I have the <meta charset="utf-8">
in the head
of the page, so I wonder if the charset encoding could be the problem.
If I make a search without the COLLATE SQL_Latin1_General_CP1_CS_AS
it works but it is case insensitive.
What could be the problem? Should I convert the database to always use utf-8?