Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jun 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Parent / Child Category Navigation

    HI

    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.E

    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.

    Cheers

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    me again. check the album/artist link on my signature below if you didn't see it on the other site first.

  • #3
    New to the CF scene
    Join Date
    Jun 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

    Cheers.

  • #4
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    Sorry I also forgot to link this article 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.

    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.

  • #5
    Senior Coder
    Join Date
    Aug 2003
    Location
    One step ahead of you.
    Posts
    2,815
    Thanks
    0
    Thanked 3 Times in 3 Posts
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •