X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=www%2Fadd-single-result.pl;h=76edbd043286c37011975375fbe977a7737e99cb;hb=da3fa6c4de949158716dd130551cf6494f3766da;hp=0037020197c48c3fdbde95f65e430ebfc747d2f3;hpb=69ada6cdd711047aca553a5242f8b878041737e9;p=foosball diff --git a/www/add-single-result.pl b/www/add-single-result.pl index 0037020..76edbd0 100755 --- a/www/add-single-result.pl +++ b/www/add-single-result.pl @@ -42,10 +42,10 @@ my ($newr2, $newrd2) = foosball::calc_rating($rating2, $rd2, $rating1, $rd1, $sc $dbh->do('INSERT INTO single_results (gametime,username1,username2,score1,score2) VALUES (CURRENT_TIMESTAMP,?,?,?,?)', undef, $username1, $username2, $score1, $score2); -$dbh->do('INSERT INTO single_rating (username,ratetime,rating,rd) VALUES (?,CURRENT_TIMESTAMP,?,?)', - undef, $username1, $newr1, $newrd1); -$dbh->do('INSERT INTO single_rating (username,ratetime,rating,rd) VALUES (?,CURRENT_TIMESTAMP,?,?)', - undef, $username2, $newr2, $newrd2); +$dbh->do('INSERT INTO single_rating (username,ratetime,rating,rd) VALUES (?,CURRENT_TIMESTAMP,?,?,?)', + undef, $username1, $newr1, $newrd1, $newr1-$rating1); +$dbh->do('INSERT INTO single_rating (username,ratetime,rating,rd) VALUES (?,CURRENT_TIMESTAMP,?,?,?)', + undef, $username2, $newr2, $newrd2, $newr2-$rating2); $dbh->commit;