I have a MySQL table of pages with these fields (id, parentID, name, content).
The page hierarchy is:
- About Us
- History
- 2000
- 2001
If I’m on page “2001” how can I create a query to find that this page’s top-level ancestor is “About Us”?
You can use something like the following pseudocode to do this in a recursive manner.