I am executing an SQL statement for use in a login, so I need to find certain details on a user based upon their username and password.
The problem I have is that each user has 4 seperate passwords which allow different levels of access. My SQL is currently like this (where 'Name' and 'Pass' are the values entered by the user for their login:
SELECT ID, LoginName
FROM SGS_Users
WHERE LoginName = 'Name'
AND (Password1 = 'Pass' OR Password2 = 'Pass'
OR Password3 = 'Pass' OR Password4 = 'Pass')
How do I change my SQL to find out which of the Password fields matched with the password that the user entered?
Any help would be much appreciated.
Cheers,
Mike
The problem I have is that each user has 4 seperate passwords which allow different levels of access. My SQL is currently like this (where 'Name' and 'Pass' are the values entered by the user for their login:
SELECT ID, LoginName
FROM SGS_Users
WHERE LoginName = 'Name'
AND (Password1 = 'Pass' OR Password2 = 'Pass'
OR Password3 = 'Pass' OR Password4 = 'Pass')
How do I change my SQL to find out which of the Password fields matched with the password that the user entered?
Any help would be much appreciated.
Cheers,
Mike