这个查询对我不起作用。我哪里做错了。请帮忙
$sql="SELECT * FROM $tbl_name WHERE ( username='$myusername' and (password='$mypassword' and password='$encrypted_mypassword'))";
这个查询对我不起作用。我哪里做错了。请帮忙
$sql="SELECT * FROM $tbl_name WHERE ( username='$myusername' and (password='$mypassword' and password='$encrypted_mypassword'))";
我假设您接受了普通密码和加密密码。试试这个...
SELECT * FROM $tbl_name WHERE username='$myusername' AND
(password='$mypassword' OR password='$encrypted_mypassword')
如果只有加密密码,试试这个...
SELECT * FROM $tbl_name WHERE username='$myusername' AND
password='$encrypted_mypassword'
未经测试,但这应该工作,
$sql="SELECT * FROM $tbl_name WHERE
Username = '$myusername' AND
Password = '$mypassword' AND
Password = '$encrypted_mypassword'";
对于您正在做的事情,不需要括号,并且您还尝试将单个字段与可能的 2 个不同值进行比较。