Aquafen
Зарегистрирован: 24.03.2004 Сообщения: 1
|
Добавлено: Ср Мар 24 2004 22:19 Заголовок сообщения: [PHP] Need Help |
|
|
Код: | $result = mysql_query("SELECT * FROM matches");
if(!$result) die("...");
while($res = mysql_fetch_array($result)){
$out_string0 = $res["match_id"];
$out_string1 = $res["team1_name"];
$out_string2 = $res["team2_name"];
$out_string3 = $res["team1_player1_skill"] + $res["team1_player2_skill"] + $res["team1_player3_skill"] + $res["team1_player4_skill"] + $res["team1_player5_skill"] + $res["team1_player6_skill"] + $res["team1_player7_skill"] + $res["team1_player8_skill"] + $res["team1_player9_skill"] + $res["team1_player10_skill"] + $res["team1_player11_skill"];
$out_string4 = $res["team2_player1_skill"] + $res["team2_player2_skill"] + $res["team2_player3_skill"] + $res["team2_player4_skill"] + $res["team2_player5_skill"] + $res["team2_player6_skill"] + $res["team2_player7_skill"] + $res["team2_player8_skill"] + $res["team2_player9_skill"] + $res["team2_player10_skill"] + $res["team2_player11_skill"];
$out_string5 = $res["team1_tactic"];
$out_string6 = $res["team2_tactic"];
if ($out_string6 > $out_string5) {
echo $a = $out_string4 +25;
print "<br>";
echo $b = $out_string3;
print "<br>";
}
}
$query="UPDATE `matches` SET `team1_bonus` = '$b', `team2_bonus` = '$a' WHERE match_id = 'match_id'; ";
$result = mysql_query ($query) or die("Invalid query: " . mysql_error()); |
значит когда происходит UPDATE, то он обнавляет только первое поле в таблице (match_id - 1), остальные поля необновляються, тоесть team1_bonus в последующих полях (match_id - 2) остается в нулевом значении.
Может кто то знает как это исправить? |
|