PHP Main and subcategorys - Structure Ideas??????

Discussion in 'PHP' started by jaymastafunk, Jan 15, 2008.

  1. #1
    **OOPS! I CANNOT EVEN SPELL SUBCATEGORIES RIGHT SORRY THERE!

    Hi there,

    I am trying to make a website that has items categorized with a main and sub-category but have NO idea what the best way to do it is.

    I was thinking of the main categories being A-Z and the sub categories being 1-infinity depending on how many there are and then having an SQL query saying something like..

    $query=" SELECT * FROM mi_business WHERE main_cat='A' AND sub_cat='2' "

    I donno how accurate that query is but its just a concept.

    Does anyone know any easier way or something I could use, because my next question is how can people even find the categories.

    Lets say they want just sub category 2 like in the query. Can I make a link that opens up a page like results.php?sub_cat=2 or something?

    I dont even know if I am illustrating my issue that well. Just let me know if you have any questions, I am wondering what other people have to say.

    THANKS!!!!
     
    jaymastafunk, Jan 15, 2008 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375