I am creating a login system in PHP. I need a user to use either his or her username or email or phone number to login then the password. since I know in java we would do like email==user^ username == user
does this apply in MySQL. Could I do something like this in MySQL?
Select * from user WHERE mail = 'user' ^ phoneNo= 'user' ^ username = 'user' and password = 'pass'
I have tried it and it failed. Alternatively, I use multiple if
s in PHP and check one at a time like this
if (mail == user){
}
The query would be -
Select * from user WHERE (mail = 'user' or phoneNo= 'user' or username = 'user') and password = 'pass'
Or
Select * from user WHERE 'user' in (mail, phoneNo, username) and password = 'pass'