Chce dodac punkty zawodnikom za udzial w meczu zalezy od wyniku.
W tabeli mecze mam oczywiscie wszystkie dane w tym najwazniejsze punkty
Pozniej z tabeli lineup pobieram dane zawodnikow, ktorzy byli w skladzie w tych meczach. I tym chce przyznac punkty zalezne od wyniku.
No i cos miesza mi sie z petlami, bo albo wyswietla wszystkich zawodnikow, ale jeden mecz, albo ...inne glupoty.
oto kod:
$host_id = $mecz['host_id']; $guest_id = $mecz['guest_id']; $host = $mecz['host']; $guest = $mecz['guest']; $score_host = $mecz['score_host']; $score_guest = $mecz['score_guest']; if ($score_guest == $score_host) { $points_host = '1'; $points_guest = '1'; } if ($score_guest > $score_host) { $points_host = '0'; $points_guest = '3'; } if ($score_guest < $score_host) { $points_host = '3'; $points_guest = '0'; } //lineup $player_id = $line['player_id']; $round_id = $line['round_id']; } $result3 = mysql_query("INSERT INTO lineup_points (points, round_id, player_id) VALUES ('$points_host', '$round_id', '$player_id') ") or die(mysql_error()); } else { $result4 = mysql_query("INSERT INTO lineup_points (points, points, round_id, player_id) VALUES ('$points_guest',, '$round_id', '$player_id') ") or die(mysql_error()); } }