View Single Post
  #1 (permalink)  
Old August 5th, 2009, 12:23 PM
melkin melkin is offline
Authorized User
Points: 483, Level: 7
Points: 483, Level: 7 Points: 483, Level: 7 Points: 483, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2007
Location: Edgewood, NY, USA.
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default creating sub categories?

hello all. I have a table that lists names of categories (i.e., Food Service, Plumbing, Lab Safety).

I have another table called subcategories. This table has names that are tagged to appear in the proper main categories listed above.

The problem is I cant figure out the code to allow a loop through the records and display the correct sub category table to appear under the correct category.

Assuming my tables are set up correctly, how can I just loop the main categories as a list, and then loop all the related sub categories to appear below them?

ie,

FOOD SERVICE (Main category)
Commercial Dishwashers (sub category)
Grills (sub category)
Sinks (sub category)

I appreciate a starting direction here. I am using MySQL and .asp
Reply With Quote