websurfer907
Oct 21st, 2000, 02:48 PM
Hello!
I just started learning PHP and MySQL about a week ago, so this is probably a stupid question :rolleyes:, but anyway...
I am using this code:
$Result = mysql_query("SELECT UserName, Password, LastLogin FROM Members WHERE UserName = '" . $username . "'");
and it works, but when somebody enters their username and it doesn't have the same case as when they registered (say, websurfer907 instead of Websurfer907) it won't work. UserName is a varchar, and every MySQL site I've seen says that varchar is case-insesitive. What am I doing wrong? I also tried this:
$Result = mysql_query("SELECT UserName, Password, LastLogin FROM Members WHERE STRCMP('" . $username . "', UserName) = 0");
and the same thing happened. Help!
I just started learning PHP and MySQL about a week ago, so this is probably a stupid question :rolleyes:, but anyway...
I am using this code:
$Result = mysql_query("SELECT UserName, Password, LastLogin FROM Members WHERE UserName = '" . $username . "'");
and it works, but when somebody enters their username and it doesn't have the same case as when they registered (say, websurfer907 instead of Websurfer907) it won't work. UserName is a varchar, and every MySQL site I've seen says that varchar is case-insesitive. What am I doing wrong? I also tried this:
$Result = mysql_query("SELECT UserName, Password, LastLogin FROM Members WHERE STRCMP('" . $username . "', UserName) = 0");
and the same thing happened. Help!