title: login with username or email address in php
body: <p>I am trying to create a login with username or email</p>
  
  <p>My code is:</p>
  
  <pre><code>$username=$_REQUEST['login'];
  $email=$_REQUEST['login'];
  $password=$_REQUEST['password'];
  
  if($username &amp;&amp; $password) {
    $query="select * from  user_db where username='$username'  and password='$password'";
  } else if ($email &amp;&amp; $password) {
    $query="select * from  user_db where email='$email' and password='$password'";
  }
  </code></pre>
  
  <p>Login with username is success but login with email is not working. Please help me!</p>