help me please .. whats the wrong in my code. I try to create login form and verified the input..
Fatal error: Uncaught Error: Call to a member function dbConnect() on null
( On  $this->$db = $this->db->dbConnect();).
this is connection.php
<?php
class connection{
    public $db_host = 'localhost';
    public $db_name = 'login';
    public $db_user = 'root';
    public $db_pass = 'root';
    public function dbConnect()
    {
        try{
            $conn = new PDO("mysql:host=".$this->db_host.";dbname=".$this->db_name,$this->db_user,$this->db_pass);
           $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        }
        catch(PDOException $e)
        {
            echo 'ERROR: ' . $e->getMessage();
        }    
        return $this->conn;
    }
}
?>
and this is login.php
<?php
include_once('connection.php');
class User{
    private $db;
    public function __construct(){
        $this->$db = new connection();
        $this->$db = $this->db->dbConnect();
    }
    public function isAuthenticated($name, $pass){
        if(!empty($name) && !empty($pass)){
            $st = $this->$db->prepare("SELECT * FROM loginUser WHERE username =? AND password =?");
            $st->bindParam(1, $name);
            $st->bindParam(2, $pass);
            $st->execute();
            if($st->rowCount() == 1){
                echo "User Verified";
            }else{
                echo "Incorrect UserName or Password";
            }
        }else{
            echo "Please Enter User Name And Password";
        }
    }
}
?>
 
     
    