I can get user inputed name(username) with following code from a form. So my question is if i put Shibbirbd (First letter is Capital but it’s shibbirbd in my database) then it’s successfully go to user login panel! But it’s wrong. why this happened?
Mysql Database username is: shibbirbd.
Login form script:
$uname = mysql_real_escape_string(htmlspecialchars(trim($_POST['uname'])));
$pass = mysql_real_escape_string(htmlspecialchars(trim($_POST['pass'])));
You can change your
WHEREclause toWHERE BINARY(WHERE BINARY uname = '$uname') to test the binary value of the usernames against one another for equality.If you would like all queries on this table to be case-sensitive, you should consider changing the collation, as @Kolink suggested.