public function getActiveUsers(){
    $result = $this->con->query("SELECT * FROM `USERS` where `IsActive`=1");
    $users = array();
    while ($item = $result->fetch_assoc()) {
        $users[] = $item;
    }
    return $users;
}//End Function
This is my PHP Function I am using to get active users from my DB (of my dashboard). Most of the other functions are written like this. They are written in a single PHP file (db-function.php). But first I defined the connection in a file called DB-Connet.php.
public function connect()
    {
        require_once 'source/config/config.php';
        $this->con = new mysqli(DB_HOST,DB_USER,DB_PASSWORD,DB_DATABASE);
        return $this->con;
    }
And then created the connection in the construct of DbConnet class in db-function.php.
function __construct()
    {
        require_once 'DB-Connet.php';
        $db = new DbConnect();
        $this->con = $db->connect();
        
    }
But when I try to visit the dashboard url It Displays a msg like this,
User adimn_user already has more than 'max_user_connections' active connections in ..../db-function.php on line 16.
What am I doing wrong? (My English is Bad. I am sorry. Edits are Wellcome. Thank you all.)
P.S : Is it okay if I close the connection in _destruct function of db-connect.php like this?
function __destruct() {
        $this->con->close();
  }