I just have a curious question that comes to my mind.
Is it possible to have two members ( or users ) having the same username but different passwords.
username for user1 and user2 is "apple".
but the password for user1 is "orange" and password for user2 is "pineapple".
Is it possible??? Are they allowed to have them???
Thanks in advanced.
Philip Zac wrote:If there is same username, but different password, then it checks the comparsion of password and then assigned to that user.
And what will happen, if both user sets the same password.
Consider, the username:password as "key:value" pair, and there shouldn't be any duplicate key.
In most databases, the password is stored as a hashed value. No way you can compare them. If two users use the same password, their password will not appear the same in a decent database.
Abhik Ghosh wrote:No, I think you have to make the username and password both unique. you can do it by comparing the new entered username and password both unique by comparing with the existing ones by using the compareToIgnoreCase function in a loop.