Can't call a function in PDO outside the class
<p>I want to create a login page in php using PDO  and I have created this class which includes the function login which makes the login.</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;? php

class Utente {

  private $db;


  function __construct($conn) {
    $this - &gt; db = $conn;
  }


  public static
  function login($nome_utente, $password) {



    $nome_utente = $_POST['nome_utente'];
    $password = $_POST['password'];

    if ($nome_utente == '') {
      echo "Fill the name";
    }

    try {

      $stmt = $this - &gt; db - &gt; prepare("SELECT * FROM utente WHERE nome_utente = :nome_utente AND password=:password");
      $stmt - &gt; execute();
      $utenteRow = $stmt - &gt; fetch(PDO::FETCH_NUM);

      if ($utenteRow &gt; 0) {

        echo "You are logged in";

      } else echo "The username doesnt match with the password!";


    } catch (PDOException $e) {
      echo $e - &gt; getMessage();
    }

  }
}?&gt;

&lt;!-- begin snippet: js hide: false console: true babel: false --&gt;</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form action="" method="POST"&gt;
  Name
  &lt;input type="text" name="nome_utente" /&gt;PAS
  &lt;input type="text" name="password" /&gt;
  &lt;input type="submit" name="submit" value="login" /&gt;
&lt;/form&gt;</code></pre>
</div>
</div>
</p>



<p>Now I want to call this function to see the result of the login.I create this new class in another php file to call it:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;?php
class Call
{
  public  function call()
    {
        $var=Utente::login();
        return $var;
    }
}
?&gt;</code></pre>
</div>
</div>
</p>

<p>The problem is when I execute the secon file with the class Call I see a blank page. Have I done something wrong? Can someone tell me how to do the login of the user in the right way? Thanks!</p>