How can I optimize the following code ,
I Need to run 3 sets of loops like this:
for($i=1;$i<=$count-1;$i++){
for($j=$i+1;$j<=$count;$j++){
// do some query use $i and $j
}
}
for($i=1;$i<=$count-2;$i++){
for($j=$i+1;$j<=$count-1;$j++){
for($k=$j+1;$k<=$count;$k++){
// do some query use $i and $j and $k
}
}
}
for($i=1;$i<=$count-3;$i++){
for($j=$i+1;$j<=$count-2;$j++){
for($k=$j+1;$k<=$count-1;$k++){
for($l=$k+1;$l<=$count;$l++){
// do some query use $i and $j and $k and $l
}
}
}
}
Is there a way to simplify the code, perhaps to connect the loops together ?
thanks !