为什么我的pdo变量始终未定义? [重复]

I have two php files, one is a file for a PDO Connection and one is a file in which a prepared statement is submitted on this connection:

PDO Connection:

class Connection {

protected $user = "ni873420_2sql1";
protected $pass = "#";
public $pdo_log;

public function __construct() {

        try {

            $pdo_log = new PDO('mysql:host=localhost;dbname=ni873420_2sql1', 
                               $this->user, $this->pass);

        }
        catch (Exception $e) {

            die($e);

        }
    }
}

And this is the function where I create the prepared statement:

    public static function getInfobyEmailUsername($argemailusername) {

    $get_info_query = "SELECT * FROM user WHERE email = ? OR username = ?";

    $conn = new Connection();
    $getinfostmt = $conn->pdo_log->prepare($get_info_query);
    $getinfostmt->execute(array($argemailusername, $argemailusername));

    $userinfo = $getinfostmt->fetch(PDO::FETCH_ASSOC);

    if (!empty ($userinfo)) {
        return $userinfo;
    } else {
        return false;
    }

    }

But I keep getting the error:

Fatal error: Call to a member function prepare() on null

I cant find a solution anywhere, can anyone help me with this or at least send a link where I can find the solution?

Thank you!

</div>

In your construct function, use the public variable $pdo_log

  $this->pdo_log = new PDO('mysql:host=localhost;dbname=ni873420_2sql1', 
                           $this->user, $this->pass);