Hi all,

i'm working on a message board and am having the following issue. I have a threads table with a reference to the category the thread is in (catid)

I then have a list of categories in the following format

name | catid | parent_id

one | 1 | 0
two | 2 0
three| 3 | 1
four | 4 | 1
five | 5 | 2
six | 6 | 4

So that each category can be linked to a parent category. When displaying the categories I basically want to show all threads that are contained in that category and any threads that are in subsequent sub categories. So for the example above clicking on category one would show threads belowing to category one,three,four and six. Is there a way to do this in SQL, or is it the database structure which needs revising?