SELECT hashed_password = '{$hashed_password}' AS is_password_correct
FROM employees WHERE email = '{$email}'
This query will return zero rows if there's no such entry matching $email.
If there is a row matching $email, the query will return either 1 or 0, based on whether the boolean equality comparison in the select-list is true or false.
You can then do different things in your app depending on the three possible states.
You should stop using the deprecated "mysql" functions in PHP, they are going away in the next version of PHP. Use mysqli or PDO.
Also you should learn to use prepared queries and pass your $hashed_password and $email as query parameters. Then you can avoid SQL injection vulnerabilities and not worry about escaping strings.
Here's a complete example (untested) with PDO:
$stmt = $pdo->prepare("SELECT hashed_password = :password AS is_password_correct
FROM employees WHERE email = :email");
if ($stmt === false) {
// always check for errors
}
$result = $stmt->execute(array(":password"=>$hashed_password, ":email"=>$email));
if ($result === false) {
// always check for errors
}
if ($stmt->rowCount() == 0) {
// no such user
} else {
while ($row = $stmt->fetch()) {
if ($row["is_password_correct"] == 1) {
// password is correct for the given user
} else {
// password is wrong
}
}
}