I am fresh learner.
I found a difficulty for "Insert combination data made PHP to MySQL"
Example: for 1,2,3,4, combination is:
123
124
134
234
I want to insert that into a MySQL database.
Result:
123
124
134
234
234 <= duplicate
I couldn't locate where is the problem is. Thank you so much. :-)
$lista = array($a,$b,$c,$d);
$b=1;
for ($i=0; $i<=3; $i++) {
for ($j=$b; $j<=4;$j++) {
for ($k=$j+1; $j<count($lista); $j++) {
printf($lista[$i].','.$lista[$j].'<br>');
$sql="INSERT INTO table10(id)
VALUES($lista[$i]$lista[$j])";
mysql_query( $sql, $con );
}
}
$b++;
}