conexion = new mysqli($this->host, $this->user, $this->password, $this->dbname); if ($this->conexion->connect_error) { die('Error de conexión: ' . $this->conexion->connect_error); } return $this->conexion; } public function cerrarConexion() { if ($this->conexion) { $this->conexion->close(); } } } ?>