PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm trying to find out how to create a tree menu using mysql database.
I have categories and subcategories.
I want to create a tree menu that the subcategories goes under the category and it shows it self when i click on the category.
It's all about your database stucture. Once that is right it's easy to build. Then you need to have a couple of variables that keep track of what category and subcategory you are on. Those variables are then past from page to page in a session cookie or in a query string. I've done it once now, but I'm no expert. That's the basic idea of it.
This did not solve my problem. Let med show you an example:
I have my Monitor for sale and it is a 17" CRT monitor. In the database it looks like this:
Category Monitor
Subcat CRT
Item 19" Samsung
On my tree menu i want to see the Category first. When i click on it the subcategory displayes and on click on the CRT I want it to show the item in that subcat.