Counting articles in heirarical category system..

Discussion in 'PHP' started by emailarron, Sep 7, 2008.

  1. #1
    This has had me stumped for a long time...

    Here is the category structure :

    Table name :CATEGORIES
    Fields : ID,CATEGORY,TITLE

    ( where CATEGORY is the parent )

    Here is my articles stucture:

    Table name: LISTINGS
    Fields, CATEGORY, (etc)

    ( CATEGORY has the ID of CATEGORIES table )

    So your basic heirarical category system...

    What I want to do is count the listings inside of the parent category... ( and the tricky part, all of it's subcategories also ... )

    any tips would be great!
     
    emailarron, Sep 7, 2008 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can you give some examples of what would be in each of the tables, and also, can you specify the data type for each field
     
    JAY6390, Sep 7, 2008 IP