otuatail Posted February 4, 2007 Share Posted February 4, 2007 I have a table in MySQL Users with ID UserName Password Security_LV Problem is this. When a user types in a user name and password. I do a SELECT on USR and PWD. If the PWD is Abcd then abcd and ABCD is valid. I want the password case sensitive. Any ideas please Paul Link to comment https://forums.phpfreaks.com/topic/37040-passwords-in-mysql/ Share on other sites More sharing options...
trq Posted February 4, 2007 Share Posted February 4, 2007 They should be case sensitive by default. Post your code that initially stores the password, and your code for varifying. Link to comment https://forums.phpfreaks.com/topic/37040-passwords-in-mysql/#findComment-176864 Share on other sites More sharing options...
otuatail Posted February 4, 2007 Author Share Posted February 4, 2007 I can't supply code for inputing data as this is currently done manual using MySQLAdmin. Here though is the database structure and the retreaval code CREATE TABLE IF NOT EXISTS `Accounts` ( `ID` int(11) NOT NULL auto_increment, `F_Name` varchar(20) NOT NULL default '', `L_Name` varchar(20) NOT NULL default '', `N_Name` varchar(10) NOT NULL default '', `Email` varchar(50) NOT NULL default '', `USR` varchar(15) NOT NULL default '', `PWD` varchar(15) NOT NULL default '', `Date` date default NULL, `Hidden` varchar(1) NOT NULL default 'N', PRIMARY KEY (`id`) ) TYPE=MyISAM; ----- $PWD = $_POST['pwd']; $USR = $_POST['usr']; $sql = "SELECT * FROM Accounts WHERE USR = '" . $USR . "' AND PWD = '" . $PWD . "'"; // echo $sql; $qAccess = mysql_query($sql) or die(mysql_error()); $Rows = mysql_num_rows($qAccess); Link to comment https://forums.phpfreaks.com/topic/37040-passwords-in-mysql/#findComment-176870 Share on other sites More sharing options...
marcus Posted February 4, 2007 Share Posted February 4, 2007 http://us3.php.net/manual/en/function.strcasecmp.php Link to comment https://forums.phpfreaks.com/topic/37040-passwords-in-mysql/#findComment-176884 Share on other sites More sharing options...
otuatail Posted February 4, 2007 Author Share Posted February 4, 2007 Thanks for all that. It would have been nice if MySQL was case sensitive. I wanted to a void a second layer test. Again THANKS Desmond. Link to comment https://forums.phpfreaks.com/topic/37040-passwords-in-mysql/#findComment-176892 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.