public function __construct() { $DB_CONNECT = new DB_CONNECT(); $this->connection = new \mysqli($DB_CONNECT->getHost(), $DB_CONNECT->getUsername(), $DB_CONNECT->getPassword(), $DB_CONNECT->getName()); if ($this->connection->connect_errno) { echo "Failed to connect to MySQLI: " . $this->connection->connect_error; } }