Perhaps you can help. I have a main class that creates a MySql connection. Then I extend this class. I wasn't able to access the connection unless I did a parent::__construct(); and recently while doing this I got an error message that I was out of connections.
So how do program this so it doesn't run out of connections and can access the database connection.
class Common
{
var $mysql;
function __construct()
{
$this->mysql=new mysqli($this->dbHOST, $this->dbUSERNAME, $this->dbPASSWORD, $this->dbNAME);
}
}
class Role extends Common {
function __construct()
{
parent::__construct();
}
}