I'm seeking suggestions for where to head next...
I'm working on creating an online content management system that allows users to create articles and set them in categories. I use 2 MySQL tables for this now but would like to simplify this into one table.
The current system has a Categories table which is used to create a menu on the web page. There is also a table called Articles that populates subitems in the menu created by the Categories table.
Ex:
About Us (pulled from Categories table)
->History (pulled from Articles table)
->Contact Info
Products
->Apples
->Peaches
The new MySQL table design will have everything in one table:
id|parentid|subject
1|0|About Us
2|0|Products
3|1|History
4|1|Contact Info
5|2|Apples
6|2|Peaches
The single table will allow me to have subitems for the subitems:
7|5|Granny Smith
8|5|Red Delicious
So a menu could now look like:
Products
->Apples
->Granny Smith
->Red Delicious
->Peaches
I would prefer to expose subitems only when a parent item has been selected.
So here's the questions...
How would I use PHP to efficiently parse through all of the (possibly infinite) subnodes in this menu?
Can anyone recommend useful pre-built code? I found dozens of cascading menu classes at phpclasses.org but hope not to test each one.
An example of what I have started is at
- - picklefish - -
Why is everyone in this forum responding to me as picklefish?
I'm working on creating an online content management system that allows users to create articles and set them in categories. I use 2 MySQL tables for this now but would like to simplify this into one table.
The current system has a Categories table which is used to create a menu on the web page. There is also a table called Articles that populates subitems in the menu created by the Categories table.
Ex:
About Us (pulled from Categories table)
->History (pulled from Articles table)
->Contact Info
Products
->Apples
->Peaches
The new MySQL table design will have everything in one table:
id|parentid|subject
1|0|About Us
2|0|Products
3|1|History
4|1|Contact Info
5|2|Apples
6|2|Peaches
The single table will allow me to have subitems for the subitems:
7|5|Granny Smith
8|5|Red Delicious
So a menu could now look like:
Products
->Apples
->Granny Smith
->Red Delicious
->Peaches
I would prefer to expose subitems only when a parent item has been selected.
So here's the questions...
How would I use PHP to efficiently parse through all of the (possibly infinite) subnodes in this menu?
Can anyone recommend useful pre-built code? I found dozens of cascading menu classes at phpclasses.org but hope not to test each one.
An example of what I have started is at
- - picklefish - -
Why is everyone in this forum responding to me as picklefish?