PHP(mysqli)找到单值

I know how to search using mysqli to find if there is at least one match. How do I go about retrieving another value from a found row. It must just require changing 1 or 2 things.

Imagine I have the following DB:

 ID     |     emailaddress     |    password
 1      |     dummy@email.com  |    DUMB1PASS
 2      |     second@email.com |    DUMB2Pass

I can use the following code to verify if the the email address "dummy@email.com" exists. How would I look up the password associated with that row (i.e. the row containing dummy@email.com).

$email = "dummy@email.com";
$servername = "correct"; $username = "correct"; $DBpass = "correct"; $dbname = "correct";
    $conn = new mysqli($servername, $username, $DBpass, $dbname);
    if ($conn->connect_error)
        {
            die("Connection failed: " . $conn->connect_error);
        } 

    $sql = "SELECT emailaddress FROM registration WHERE emailaddress = '$email'";
    $result = $conn->query($sql);

    if ($result->num_rows > 0)
        {
            echo "we found a match";
        } 
    else
        {
            echo "we did not find a match";
        }

I imagine I can do something like:

$email = "dummy@email.com";
$servername = "correct"; $username = "correct"; $DBpass = "correct"; $dbname = "correct";
    $conn = new mysqli($servername, $username, $DBpass, $dbname);
    if ($conn->connect_error)
        {
            die("Connection failed: " . $conn->connect_error);
        } 

    $sql = "SELECT password FROM registration WHERE emailaddress = '$email'";
    $result = $conn->query($sql);

    if ($result->num_rows > 0)
        {
            echo "the value is '$result'";
        } 
    else
        {
            echo "we did not find a match";
        }

However, it produces this error:

Catchable fatal error: Object of class mysqli_result could not be converted to string in MYPAGE on line XX.

I think that the cause of this is likely that $result is an array or something. However, I don't know enough about sql/php to know if that is the problem, or how to pull the result from it if it is the case.

I'd really appreciate any help.

You need to fetch the row first, try this:

if ($result->num_rows) {
  $row = $result->fetch_row();
  echo 'the value is: ', $row[0];
}