Hi,
I have a table with username and password. The password is encrypted using
mySQL's password function. But when I try to perform a match using PHP,
e.g.,
$query = "select count(*) from auth
where usrname='$logname' and usrpass=password('$logpass')";
$result = mysql_query($query) or exit ("Cannot run query.");
$count = mysql_result($result, 0, 0);
if ($count > 0)
{
echo "Success";
die();
}
else
{
echo "Unsuccess";
die();
}
I always get "Unsuccess". It seems password() does not give the same result.
Would someone please point out what I am doing wrong here?
Regards,
Norman
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php