This is my login form. I want to check username from company name or by nik_name, and password is mandatory field. As like facebook in which we can login from contact number or email, as like that i want to login from either company name or nick name.
<input type="text" class="form-control login-field" value=""
placeholder="Username / Company Name" id="login-name" name="email" />
<input type="password" class="form-control login-field" value=""
placeholder="Password" id="login-pass" name="password" />
This is my SQL query to check nickname and password:
SELECT *
FROM buyers_login
WHERE nik_name = "' . mysql_real_escape_string($loginEmail) . '"
AND password = MD5("' . $loginPassword . '")
LIMIT 1
What will be the SQL query to check companyname or nickname with password ???