I am trying to save some Website Links into a Database table and then print them to screen with PHP.
The part I need help with is that some of the Link records will act as parent
records and then child
records will be under it;s parent.
The goal is to generate something like the image below but pulling the link records from a MySQL Database with PHP.
I am not sure how best to structure the database for this. AS a start I have added a column called parent
in which I figured that each link record could have the ID
of the Parent
record.
A Parent record will act as a Folder/Directory.
My Databse structure as of right now...
id
title
description
url
permission
notes
active
sort_order
parent (will have the ID number of the parent folder/link of this link)
Based on this, how could I pull the records with PHP and make sure that the links stay under the parent link records like in the image?
Does my Database need to be changed to do this?