Firstly thanks for reading!
I Have an Array($options) -
[9] = [12], [18], [20]
[12] = [3], [6]
[18] = [19], [13]
Basically I want something that can give me all of the possible combinations. within a loop -
1 = 12,3,19
2 = 12,3,13
e.t.c.
while(something){
$x++;
$insert = "insert into table(`id`,`option`,`value`) values('x','x','x');
$insert = "insert into table(`id`,`option`,`value`) values('x','x','x');
$insert = "insert into table(`id`,`option`,`value`) values('x','x','x');
}
So the first combination would be entered as 3 rows into the database as so:
$insert = "insert into table(`id`,`option`,`value`) values('100','9','12');
$insert = "insert into table(`id`,`option`,`value`) values('100','12','3');
$insert = "insert into table(`id`,`option`,`value`) values('100,'18','19');
Next lot:
$insert = "insert into table(`id`,`option`,`value`) values('101','9','12');
$insert = "insert into table(`id`,`option`,`value`) values('101','12','3');
$insert = "insert into table(`id`,`option`,`value`) values('101','18','13');
Hope somebody can help me. It needs to be something that works no matter how many values there are within the array.