我正在尝试验证用户登录名,将我输入的密码与用户输入的密码匹配
我的插入查询:
insert into login (Emp_id, Emp_Fname, Emp_Lname, Username, Password) values (5, 'TestFName', 'TestLName', 'Test', password('april'));
它将密码存储为该值:
*72B46CDA233C759A88BEF81F59F66D78B26B2848
select * from login where password = '*72B46CDA233C759A88BEF81F59F66D78B26B2848'; -- this line shows me the result
select password('april'); -- this returns *72B46CDA233C759A88BEF81F59F66D78B26B2848
select * from login where password = 'password(april)'; -- this returns an empty set
除了这行代码,还有其他选择吗?
最佳答案
我认为您需要使用:
select * from login where password = password('april');
因此,不要引用整个
password
函数,而不要引用该函数的参数。