+ 1
SQL SELECT Boolean condition (Login)
I created a simple login form that works with SQL. I don't want to request the password from the server with "SELECT password FROM users WHERE username='username';" But I would rather like to test the condition with SQL like: "SELECT (Password == inputPassword)" But I don't know the right sql code for it.
1 ответ
+ 4
I came up with this solution:
SELECT 'true' as Value FROM users WHERE Name = 'Username' AND password = 'Password';
so in the end if these conditions exist, it will return a single record with a single column with the value of "true"