Hallo,I'd need a MySQL query to transform my nested sets structure into XML. (no PHP).The Problem is how to close all tags correct. EXAMPLE:A[01,16]B[02,03] C[04,13] H[14,15] D[05,12] E[06,07] F[08,11] G[09,10]<A>content A<B>content B</B><c>content C<C>content D<E>content E</E><F>content F<G>content G</G></F></D></C><H>content H</H></A>
TESTING CONTENT:CREATE TABLE IF NOT EXISTS `tree` ( `id` int(11) NOT NULL, `tag` varchar(100) NOT NULL, `lft` int(11) NOT NULL, `rgt` int(11) NOT NULL, `desc` text NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1;INSERT INTO `tree` (`id`, `tag`, `lft`, `rgt`, `desc`) VALUES(1, 'A', 1, 16, 'content A'),(2, 'B', 2, 3, 'content B'),(3, 'C', 4, 13, 'content C'),(4, 'D', 5, 12, 'content D'),(5, 'E', 6, 7, 'content E'),(6, 'F', 8, 11, 'content F'),(7, 'G', 9, 10, 'content G'),(8, 'H', 14, 15, 'content H');
thanks a lot for helping