I think the best way to do this is to set up two tables. One for the main
topic list, then one for each sub topic. You may already have this but I
cant see it here. Anyways to get your selection order correct you could do
something like:SELECT * FROM forum ORDER BY parent_id, id

Have any exampls of what you tried? And what exactly didnt work or turn
out right?-Nick

> I am trying to get something like the following:
>
> Title
> ---------------------
> topic #1
>       sub topic #1.1
> topic #2
>       sub topic #2.1
>       sub topic #2.2
>
> from the following table (I am using php for scripting).
>
> forum
> ------------
> id                    int
> parent_id             int (refers to the forum.id field)
> title
> ...
>
> How can I get the above output in the correct order since the posts
> into the table can come in any order?  I have tried various order by's
> and group by's.
>
> I am so lost on this.
>
> Thanks in Advance,
> Scott Hathaway
> query, sql
>
> ---------------------------------------------------------------------
> 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

Reply via email to