Did I fetch the result correctly?

I’m still learning, so don’t judge too harshly:

public function getUserNameByEmail($usE)
{
    if ($result = $this->mysqli->prepare('SELECT `name` FROM `table` WHERE `email`=? LIMIT 1'));
    {
        $result->bind_param("s",$usE);
        $result->execute();
        $result->bind_result($name);
        $result->fetch();
        $result->close();
    }
        return $name;
}

In principle, it works, there are no complaints, but I now need to write about a dozen such functions, playing it safe. In general terms, I need to choose 1 value based on the other. It’s just that the tutorial I’m using doesn’t say how it’s done. I hope you understand.


Answer 1, authority 100%

If the question is specifically about this function, then it is quite correct.
You can also do buffering:

$result->bind_param("s",$usE);
$result->execute();
$result->bind_result($name);
$result->store_result() // ,  
$result->fetch();
$result->close();