mysql - How to make a query with nested structure? -


i have following table structure: table forum

forum_id | parent_id 

where parent_id - nesting depth table thread

thread_id | forum_id 

where forum_id -foreign key table forum table message

message_id | thread_id 

where thread_id-foreign key table thread how can count number of messages particular forum? (сonsidering there may nested forums) sorry english, thanks.

at moment mysql doesn't seem supporting recursive sql queries. although, might consider changing data structure achieve goal easier.

take look, example, @ question: what efficient/elegant way parse flat table tree?


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -