knobbel Posted January 21, 2009 Share Posted January 21, 2009 I've a table documents and a table categories. Table documents: id | title | author | category_id 1 | test title | Johny | 2 2 | test2 | Peter | 2 Table categories: id | categoryname | sub_from_id 1 | books | 0 2 | nature | 1 3 | school | 1 The table categories contains subcategories from (sub)categories. How can I get an overview of ALL documents in the right (sub)category? Output sample: Books Nature Test title Test2 School Quote Link to comment https://forums.phpfreaks.com/topic/141834-query-with-subcategories/ Share on other sites More sharing options...
fenway Posted January 27, 2009 Share Posted January 27, 2009 Read the sticky on hierarchical data -- it's not trivial to recurse it the way you've stored it. Quote Link to comment https://forums.phpfreaks.com/topic/141834-query-with-subcategories/#findComment-747503 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.