Hi
I need advice and help on how to build up a URL based on linked values in my database table.
Attached is a very small example of how my website 'sections' table works. In short, I have an ID, CHILDOF, NAME and URL field for each section of my website.
A Top Level menu item has the CHILDOF value set to 0, and each sub menu of a top menu item has it's CHILDOF value set to the ID value of its parent. (see the attachment for example). I have got the links working through a navigation tree (when you click the parent, the sub options expand) however I need to be able to just display any link at random from the whole table directly on my homepage, so the user can click it and be directed to that sub section instantly.
Can someone help me out an show me how I would loop through the table to build up a string containing the URL field for the 'Counselling Services' section (for example), by using the CHILDOF value to detect which parent is assigned to the record? I am assuming this will need to be done via the use of Arrays, hence my post title, but I maybe wrong.
My end result should be: /services/consultations/counselling-services
Many Thanks for reading and I hope I have been clear with my requirements.
K