The login option is the same for both email and username. Not entirely wrong if you have one login window that also accepts.
You can put a condition in the query if you are not sure if this is a letter or username.
$login=$_REQUEST['login'];
$query = "select * from user_db where ( username='$login' OR email = '$login') and password='$password'"
Edit:
PDO- , SQL-. , :
$query = "
SET @username = :username
SELECT * FROM user_db
WHERE ( username = @username OR email = @username)
AND password = :password
";
$statement = $pdoObject->prepare($query);
$statement->bindValue(":username", $login, PDO::PARAM_STR);
$statement->bindValue(":password", $password, PDO::PARAM_STR);
$statement->execute();