i'm new to pdo because i'm habitual to using mysql procedural so i have made a conn.php in which i'm having database connectivity
<?php
class Connection{
private $localhost="xxxx";
private $username="xxxx";
private $dbname="xxxx";
private $password="";
public $conn="";
function __construct(){
    $this->connect();   
}
function connect(){
try {
    $this->conn = new PDO("mysql:host=$this->localhost;dbname=$this->dbname", $this->username, $this->password);
    // set the PDO error mode to exception
    $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $this->conn->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
    }
catch(PDOException $e)
    {
    echo "Connection failed: " . $e->getMessage();
    }}
}
?>
and including it in another file named function.php
<?php
include("conn.php");//here i'm including connection
Class Query{
    function _construct(){
        $this->select();
    }
    function select(){
$sql = "SELECT * FROM demotable";   
    $result = $conn->query($sql);
    if($result->rowCount() > 0){
        echo "<table>";
            echo "<tr>";
                echo "<th>id</th>";
                echo "<th>first_name</th>";
                echo "<th>last_name</th>";
                echo "<th>email</th>";
            echo "</tr>";
        while($row = $result->fetch()){
            echo "<tr>";
                echo "<td>" . $row['id'] . "</td>";
                echo "<td>" . $row['first_name'] . "</td>";
                echo "<td>" . $row['last_name'] . "</td>";
                echo "<td>" . $row['email'] . "</td>";
            echo "</tr>";
        }
        echo "</table>";
        // Free result set
    } else{
        echo "No records matching your query were found.";
    }
}
}
?>
but my problem is that it isnt showing anything no error no output nothing
