hi, I have a php script that I use to retrieve a username from mysql like so:
if (isset($_POST['username'])) {
$username = mysqli_real_escape_string($link, $_POST['username']);
$check_for_username = mysqli_query($link, "SELECT username FROM members WHERE username = '$username'");
and then I create part of my session like this:
$_SESSION['username'] = $username;
My question is, how can I make it so the result from the mysql query retrieves the username exactly as it is stored in the db?
Currently I can post whatever case format I want (UsErnamE or UsERNAME) and the username will always display in future echos however I typed it in the form.
I want it to only display as it is stored in the DB.
If this is not a MySQL question I apologize, but it seems like it would be to me…
Reading the OP again, you might be right.
I thought he meant he always got a value returned, even if he shouldn’t (like: the value in the database is ‘John’, I type ‘john’ and it still returns a value), because the select is case insensitive and he didn’t want that.