Welcome Guest, Not a member yet? Register   Sign In
Username And Email Login Form Validation Question
#5

Why? Because of performance.

I believe it's best practice to make as simple sql queries as possible. I you can get rid of a OR statement in your query with a few lines of php I believe it's woth it anytime.

Compare using
Code:
SELECT id,username,email,salt FROM users WHERE email='PostData' LIMIT 1
(Or if you determine 'PostData' is not a valid emailaddress)
Code:
SELECT id,username,email,salt FROM users WHERE username='PostData' LIMIT 1

To:
Code:
SELECT id,username,email,salt FROM users WHERE email='PostData' OR username='PostData' LIMIT 1
Reply


Messages In This Thread
RE: Username And Email Login Form Validation Question - by Diederik - 04-13-2017, 12:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB