I need to write a php script that does ... something on every possible combination of a mysql recordset
Example:
Product "Car"
Option 1: Fuel
Option 1 values: Gasoline, Petrol
Option 2: Color
Option 2 values: Red, Blue, Green
Option 3: Doors
Option 3 values: 3, 5
I need something that does some code for each possibile combination between all options/values pair, like
Combination 1: Gasoline, Red, 3
Combination 2: Gasoline, Red, 5
Combination 3: Gasoline, Blue, 3
Combination 4: Gasoline, Blue, 5
...
Combination 10: Petrol, Blue, 5
..
Combination 100: Petrol, Green, 5
Of course, option numbers and option values numbers are dynamically generated
How should I proceed?