2
Well, I created a table and entered a value into a field using SHA1(Encrypt), and I don’t know how to select the value by this 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 so:
SELECT * FROM `users` WHERE `password` = SHA1('admin')
Returns:
MySQL não retornou nenhum registo. (O Query demorou 0.0040 sec)
Does anyone know how? Thank you.
password
must be 40 characters, not 32.– Beterraba