mysqli = new mysqli($host, $user, $password, $dbname); // Verificar conexión if ($this->mysqli->connect_error) { throw new Exception("Database: Conexión fallida. " . $this->mysqli->connect_error); } } catch (Exception $e) { throw new Exception("Database: Error . " . $e->getMessage()); } } public static function getInstance() { if (self::$instance === null) { self::$instance = new Database(); } return self::$instance->mysqli; } } ?>