Jump to content

Case sensitive comparison


proud

Recommended Posts

I designed a login form and when the user logs in with his username and password I want to make sure that they are identical to the ones in the database (case sensitive), so I tried this code but it did not work; if you login with (jack) or (JACK) both are accepted.

 

 

	

$sql = "SELECT user_name FROM users WHERE STRCMP(user_name,'$userid') = 0
UNION
SELECT user_pass FROM users WHERE STRCMP(user_pass,'$password') = 0"; 

    $result=mysql_query($sql);
    $row = mysql_fetch_array( $result );

 

 

So is there any idea what is going wrong?

Link to comment
https://forums.phpfreaks.com/topic/61674-case-sensitive-comparison/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.