I have this system with configuration items and combinations made of these configuration items. What I try to achieve is selecting the combinations which are not yet made.
System example:
Configuration apple id's: 1, 2, 3
Configuration peer id's: 4,5,6,7,8
Configuration mango id's: 9,10,11,12,13
The combination is always in the order apple, peer and then mango.
For now I try to accomplish to make all possible combinations of the available configuration items.
Thus: Apple id: 1 Peer id: 4 Mango id: 9
Another combination: Apple id: 1 Peer id: 4 Mango id: 10
Etcetera.
I wonder how to make all possible combinations from the apple, peer and then mango id's.
Hopefully I describe it clearly. I have no idea how to accomplish this but my first guess is:
$apples = array();
query select appleid FROM apples
while($apples_sql = mysqli_fetch_assoc($result)) {
{
$apples[] = $row["appleid"];
}
$peers = array();
query select peerid FROM peers
while($peers_sql = mysqli_fetch_assoc($result)) {
{
$peers[] = $row["peerid"];
}
$mango = array();
query select mangoid FROM mango
while($mango_sql = mysqli_fetch_assoc($result)) {
{
$mango[] = $row["mangoid"];
}
Then I have all apples, peers and mango ID's in an array. But then I have no idea how to make the combinations.
Hopefully someone can help me out. Any help is much appreciated, thanks in advance.