Hello,
I assume the following:
Initially you store the password in the database with something like:
update user set user_passwd = password($userpasswd) where user_id = $uid;
In this case, th password is encrypted in the DB.
If you test your login function, you have something like:
select user_id from user
where user_name = $login_name
and user_passwd = $login_passwd;
If you have a match, the user is identified.
This works as long as your password is not encrypted, as you compare text-strings.
To compare with the encrypted password, you have to ewncrypt the user-input to have a match:
select user_id from user
where user_name = $login_name
and user_passwd = password($login_passwd);
I hope I understood your problem, as there were not a lot of details.
JJ Mouris