Categories and forums DB structure

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
Hervé
Registered User
Posts: 414
Joined: Tue Jun 04, 2019 7:51 am
Location: Belgium
Name: Rudy
Contact:

Categories and forums DB structure

Post by Hervé »

Hi,
I wonder how phpBB organizes the structure of categories and (sub-)forums.
For instance my forum looks like this (C = Category, F = Forum)
  • C Gestion
    • F Règlement
    • F Mode d'emploi
  • C Les animaux
    • F Les coraux
    • F Les poissons
  • C Techniquess
    • F L'eau
    • C Le matériel
      • F Éclairage
      • F Circulation de l'eau
      • ...
  • ...
Which column in which table determines the structure with this hierarchy ?
Thanks in advance to the DB specialists.
User avatar
warmweer
Jr. Extension Validator
Posts: 11234
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: Categories and forums DB structure

Post by warmweer »

Hervé wrote: Tue Aug 16, 2022 8:19 am Hi,
I wonder how phpBB organizes the structure of categories and (sub-)forums.
For instance my forum looks like this (C = Category, F = Forum)
...
Which column in which table determines the structure with this hierarchy ?
phpbb_forums

forum_id is the identifier
parent _id is the forum_id of the forum which contains the forum with forum_id (so a 0 implies a category)

Examine that table for your board and investigate the column forum_parents.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: Categories and forums DB structure

Post by david63 »

Hervé wrote: Tue Aug 16, 2022 8:19 am which table determines the structure
The forums table
Hervé wrote: Tue Aug 16, 2022 8:19 am Which column
Several - parent_id, left_id, right_id, forum_parents

Whatever you do - DO NOT try changing any of those table columns manually as you will almost certainly break your board.
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
Hervé
Registered User
Posts: 414
Joined: Tue Jun 04, 2019 7:51 am
Location: Belgium
Name: Rudy
Contact:

Re: Categories and forums DB structure

Post by Hervé »

Thanks for your reply.
I don't intend to modify anything, just try to understand.
I had already looked at this table but I don't understand how the elements appear in a certain order.
For instance part of my example : "Règlement" and "Mode d'emploi" have both "Gestion" as parent.
Why all this appears like this
  • C Gestion
    • F Règlement
    • F Mode d'emploi
and not like that ?
  • C Gestion
    • F Mode d'emploi
    • F Règlement
Can you tell me more about left_id, right_id ?
Hervé
Registered User
Posts: 414
Joined: Tue Jun 04, 2019 7:51 am
Location: Belgium
Name: Rudy
Contact:

Re: Categories and forums DB structure

Post by Hervé »

Sorry, I've found the explanation here https://www.sitepoint.com/hierarchical-data-database-2/.
This is clear, problem solved, thanks.
Post Reply

Return to “[3.3.x] Support Forum”