'103.174.180.85', 'username' => 'ufaerptmd', 'password' => 'DBerp2022!!', 'database' => 'ufaerptmd_v2', 'dbdriver' => 'mysqli' ); private $_host, $_username, $_password, $_database; public static function getInstance() { if(!self::$_instance) { // If no instance then make one self::$_instance = new self(); } return self::$_instance; } private function __construct() { $this->_host = $this->_db['hostname']; $this->_username = $this->_db['username']; $this->_password = $this->_db['password']; $this->_database = $this->_db['database']; $this->_connection = new mysqli($this->_host, $this->_username, $this->_password, $this->_database); if ($this->_connection->connect_error){ trigger_error("Failed to conencto to MySQL: " . $this->_connection->connect_error(), E_USER_ERROR); } } private function __close() { return $this->_connection->close(); } public function getConnection() { return $this->_connection; } }