This probably isn't best handled by mysql...use associative arrays to store members of members in the hierarchy, then print out the associative array's contents in order.
Peter <^_^> --------------------------------------------- Peter Grigor Hoobly Classified Ads http://www.hoobly.com ----- Original Message ----- From: "Lars Rasmussen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 14, 2003 7:46 AM Subject: mysql with subs > Hej all, > > I have a really kinky mysql problem. > > Well lets start, > I have a table that looks like this > +--------+--------------+-------------+ > | id | title | subid | > +--------+--------------+-------------+ > | 1 | MAIN | 0 | > +--------+--------------+-------------+ > | 2 | MAIN2 | 0 | > +--------+--------------+-------------+ > | 3 | sub1 | 2 | > +--------+--------------+-------------+ > | 4 | sub1sub | 3 | > +--------+--------------+-------------+ > | 5 | sub2-1 | 3 | > +--------+--------------+-------------+ > | 6 | sub2-2 | 3 | > +--------+--------------+-------------+ > > The id is the primary key, the title is just a text field, and subid is > the reference to witch id it is sub to. > > I need these datas to be called in the following order > MAIN > MAIN2 > +- sub1 > '-sub1sub > '-sub2-1 > +- sub2 > '-sub2-2 > > AND SO ON, it's supposed to go to as many subs as possible...(for > example down 100 subs) > > I hope you can make a sql command that can make it for me..... > THANK YOU! > > //Regards > > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php