Last post May 29, 2018 01:25 AM by MuhammadNaveedHaroon
May 28, 2018 09:08 AM|MuhammadNaveedHaroon|LINK
I have table:
and on signup i have fields called User & Password. I want to get that user which email or name or username or mobile number will be matched. such as:
If i want to login with username or email or mobile with password, it gives its ID. combination like:
Username: nando Naveed Haroon 0123012301 firstname.lastname@example.org
Password: password password password password
Muhammad Naveed Haroon
May 28, 2018 09:24 AM|PatriceSc|LINK
My understanding is that you want a SQL where clause ? It could be something such as :
SELECT Id FROM YourTable WHERE (UserName=@identifier OR
Email=@Identifier) AND Password=@Password
Make sure it won't make things more confusing for users. I would suggest to reuse what ASP.NET offers unless you have a strong reason for not doing so.
May 29, 2018 01:25 AM|Deepak Panchal|LINK
I can see that your table contains id, username, name, mobile, email but where you store the password?
If you store the password in any other table then you may need to use join query.
In that case, you can try to refer example below.
I try to create 2 dummy table.
select user_data.id from user_data
inner join password_data
You can try to modify the query based on your requirement.
Jun 09, 2018 05:48 AM|MuhammadNaveedHaroon|LINK
Your provided query is:
but issue is that i have only 2 fields. UserText & Password.
UserText is like aaaa or 7894561234
Password is like 12345
The user will not give different things: user_data.name='aaaa'