I'm fairly proficient with PHP but a lousy programmer. I need to figure this out for a project and I'm kinda drawing a blank. Maybe someone out there can point me in the right direction. I have a table of groups and a table of options I need to somehow generate a list of all possible combinations using one option from each group. Example: Table 1 (Groups): id|name ------- 1|AAA 2|BBB 3|BBB Code (markup): Table 2 (Options): id|parent|name 1|1|A1 2|1|A2 3|1|A3 4|2|B1 5|2|B2 6|2|B3 7|3|C1 8|3|C2 9|3|C3 Code (markup): Desired Result: A1B1C1 A1B1C2 A1B1C3 A1B2C1 A1B2C2 A1B2C3 A1B3C1 A1B3C2 A1B3C3 A2B1C1 A2B1C2 A2B1C3 A2B2C1 A2B2C2 A2B2C3 A2B3C1 A2B3C2 A2B3C3 etc.. Code (markup): Your expert advice is much appreciated.
would you like to solve this in mysql? Is it correct that if you had 4 groups, then first combination would look like A1B1C1D1? how many groups do you have for your task?