How to group subcategories in categories

Discussion in 'PHP' started by Kload, Mar 11, 2011.

  1. #1
    Ok now i have two tables one is category and the other is subcategory ok now my problem is that i want to put the heading as category and then subcategories should be displayed like this

    category 1
    sub cat1
    sub cat2

    category2
    sub cat1
    sub cat2

    i mean both will have different values and the table is like

    category
    id
    title

    sub cat
    id
    cat id
    title

    so can anyone help??
    i know it will work with do while but still i am not able to do that..
     
    Kload, Mar 11, 2011 IP
  2. Life55

    Life55 Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You mean that you want to display main cat and subs cats without 2 while ?!
     
    Life55, Mar 11, 2011 IP
  3. Kload

    Kload Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    No i want to display it in groups like

    category 1
    sub cat11
    sub cat12

    category2
    sub cat21
    sub cat22
     
    Kload, Mar 11, 2011 IP