I am creating a forum system that is divided by sections. Each section contains categories, each category contains topics. Ex:
Administração _
|_Regras da do fórum
|_Sugestões e críticas
Aeromodelismo _
|_Elétricos _
|_Glow |-Tópico 1
|-Tópico 2
|-Tópico N
When I enter the forum I need to pick up the last topics answered where where ) the section id = X.
In summary I need to get the last topics answered within a specific section, but it should be noted that in the 'topics' table the foreign key refers to the category, and in the 'categories' table the foreign key refers to the section, that is, the topics are 'grandchildren' of the sections.