I have a category system like this, its two levels deep, and goes no deeper:
A
1
Item
Item
Item
2
Item
Item
Item
3
Item
Item
Item
4
Item
Item
Item
5
Item
Item
Item
B
1
Item
Item
Item
2
Item
Item
Item
3
Item
Item
Item
4
Item
Item
Item
5
Item
Item
Item
A,B,C,D,E,F all have 5 child categories, and all child categories have three items inside them.. If they don't have three items inside them, then I want <CFSET Alert="Red">...
Here's what I'm thinking.. Each Item ID would be something like this
A1_0001
A2_0020
A3_0057
B6_0121
The first character is the TL Category, the second is the parent category, the underscore is meaningless and the last four digits are an id of the actual item..
So if in C-5 the user selects "Christmas" with an id of 238, the id sent to the database is:
C5_0238 would be sent to the database.. Now I know, you're probably thinking this is easy.. and it is, but the problem is in the next step, I don't want to run 30 queries to make sure the user has selected 3 items from each Sub Category.. Is there a way in CFQUERY to say this maybe?
Because of this dilemna.. I have no definite table structure up.. So anyway to make this work is fine.. or if you can think of a better way, it would be very much appreciated.
Thanks
Tony Hicks
AIM: Clickthru Bible | YIM: Webmigit | MSN: webmigit@hotmail.com [ Founder of <A href=" online bible. ]
A
1
Item
Item
Item
2
Item
Item
Item
3
Item
Item
Item
4
Item
Item
Item
5
Item
Item
Item
B
1
Item
Item
Item
2
Item
Item
Item
3
Item
Item
Item
4
Item
Item
Item
5
Item
Item
Item
A,B,C,D,E,F all have 5 child categories, and all child categories have three items inside them.. If they don't have three items inside them, then I want <CFSET Alert="Red">...
Here's what I'm thinking.. Each Item ID would be something like this
A1_0001
A2_0020
A3_0057
B6_0121
The first character is the TL Category, the second is the parent category, the underscore is meaningless and the last four digits are an id of the actual item..
So if in C-5 the user selects "Christmas" with an id of 238, the id sent to the database is:
C5_0238 would be sent to the database.. Now I know, you're probably thinking this is easy.. and it is, but the problem is in the next step, I don't want to run 30 queries to make sure the user has selected 3 items from each Sub Category.. Is there a way in CFQUERY to say this maybe?
Because of this dilemna.. I have no definite table structure up.. So anyway to make this work is fine.. or if you can think of a better way, it would be very much appreciated.
Thanks
Tony Hicks
AIM: Clickthru Bible | YIM: Webmigit | MSN: webmigit@hotmail.com [ Founder of <A href=" online bible. ]