Well, I created a table and entered a value into a field using SHA1 (encrypt), and I do not know how to select the value for that encrypted field. TABLE:
CREATE DATABASE IF NOT EXISTS 'quest';
USE 'quest';
CREATE TABLE IF NOT EXISTS 'users'(
'username' CHAR(32) DEFAULT NULL,
'password' CHAR(32) DEFAULT NULL,
'email' varchar(100) DEFAULT NULL,
'perm' int(10) NOT NULL DEFAULT 1,
UNIQUE KEY 'username' ('username')
);
INSERT:
INSERT INTO 'users'('username', 'password', 'email', 'perm') VALUES ("admin", SHA1("admin"), "[email protected]", 2);
I tried to do this:
SELECT * FROM 'users' WHERE 'password' = SHA1('admin')
Return:
MySQL não retornou nenhum registo. (O Query demorou 0.0040 sec)
Does anyone know how to do it? Thank you.