I'm designing a hierachical menu that is dynamic using MySQL and PHP. What I am trying to achieve is for the menu to display the child menu for the selected parent as well as the non-selected parents.
For example:
PARENT 1
CHILD 1
CHILD 2
PARENT 2
PARENT 3
What I am doing now is echoing the parent from the URL and then selecting the children from that value. I then echo the parents that are not the value in the URL. This works, but each time I click on a parent that value is displayed at the top of all of the other parents.
Does anyone have any suggestions on how to implement this in a better way?
Thanks.