Red highlight item.$query=mysql_query("select * from member");while (list($mno,$id,$pw,$nick,$team)=mysql_fetch_row($query)){ $mgoal=$_POST["goal$mno"]; $massist=$_POST["assist$mno"]; $attend=$_POST["attend$mno"]; if ($attend!="") { $attend="checked"; } $check=mysql_query("select * from record where matchid='$no' and mno='$mno'"); $row=mysql_num_rows($check); if ($row==0) $record="insert record (matchid,mno,mgoal,massist,attend) values ('$no','$mno','$mgoal','$massist','$attend')"; mysql_query($record); echo "a"; } else { $update="update record set mgoal='$mgoal',massist='$massist',attend='$attend' where matchid='$no' and mno='$mno'"; mysql_query($update); echo $no; }}