View Full Version : Parent / Child Category Navigation

06-24-2006, 12:21 AM

What I am trying to is build a navigation menu which will echo all the categories from my mysql database with the specificic subcategoires below them. So my navigation echos all Parent (categories) with their children (subcategories)

My database contains: id, category, subcategory.



I can query the database so it echos all categories, and then echos all subcategories but the problem I have is each category echos the same subcategory underneath it.


06-24-2006, 01:12 AM
me again. check the album/artist link on my signature below if you didn't see it on the other site first.

06-24-2006, 01:44 AM
Thankyou very much for your post(s). I'm working myself through this tutorial right now, it's a bit of an eye opener to MYSQL.


06-24-2006, 05:16 AM
Sorry I also forgot to link this article (http://dev.mysql.com/tech-resources/articles/hierarchical-data.html) on managing hierarchical data.

If you really need to delve into this type of stuff may I also suggest a book by Joe Celko Trees and Hierarchies in SQL for Smarties (http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&isbn=1558609202&itm=1).

If you are just getting involved with mysql itself that book may be a bit too advanced. The article I've linked though is quite straight forward.

06-24-2006, 11:46 AM

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum