Unable to login with email or mobile.Any help please? : I am trying to login with email or mobile(in php and mysql).But I am unable to login.Could anyone help me?Here is my code

    $sql = "SELECT * FROM tb_users WHERE (email='$loginEmailOrMobile' AND password='$loginPassword') OR (mobile_number='$loginEmailOrMobile' AND password='$loginPassword')";
	$mysql = mysql_query($sql) or die(mysql_error());
	if(mysql_num_rows($mysql) == 1)
	{
		echo "login successful";
		$user = mysql_fetch_object($mysql);
		echo $user->username;
	}
	else
	{
		die(mysql_error());
	}