I have the following script as a login:
//======================================================================
// LOGIN
//======================================================================
if (mysqli_real_escape_string($mysqli, $_GET['handler']) == "login") {
$User = mysqli_real_escape_string($mysqli, $_GET['param2']);
$Password = mysqli_real_escape_string($mysqli, $_GET['param3']);
$result = $mysqli->query("SELECT * FROM ".$Usr." WHERE Benutzer = '" . $User . "' AND Passwort = '" . $Password . "'");
if ($result->num_rows == 0) {
echo "Not found"; //Not successfully
} else {
echo "Found!"; //Successful
}
}
Well, that works BUT.. When in my table is a user "jürgen", my login always return "Found", when I type in jürgen OR jurgen. So the ü is even with the u what is not correct. I tried to change the charset on top of my PHP-file:
$mysqli = new mysqli($servername, $username, $password, $db);
$mysqli->set_charset("utf8");
No success. When I change a different char, it returns "Not found", so it has to be the u/ü.. How can I fix that?