function differenz($userid, $liga)
{
$season = getSeasonName($liga);
require("./asset/mysql.php");
$summe1_sql = $mysql->prepare("SELECT SUM(s1_ergebnis) AS value_sum FROM eingaben WHERE spieler1 = :userid AND season= :season AND gespielt= 2 AND liga = :liga");
$summe1_sql->bindParam(":userid", $userid);
$summe1_sql->bindParam(":season", $season);
$summe1_sql->bindParam(":liga", $liga);
$summe1_sql->execute();
$summe1 = $summe1_sql->fetch(PDO::FETCH_ASSOC);
require("./asset/mysql.php");
$summe2_sql = $mysql->prepare("SELECT SUM(s2_ergebnis) AS value_sum2 FROM eingaben WHERE spieler2 = :userid AND season= :season AND gespielt= 2 AND liga = :liga");
$summe2_sql->bindParam(":userid", $userid);
$summe2_sql->bindParam(":season", $season);
$summe2_sql->bindParam(":liga", $liga);
$summe2_sql->execute();
$summe2 = $summe2_sql->fetch(PDO::FETCH_ASSOC);
$summe = $summe1['value_sum'] + $summe2['value_sum2'];
require("./asset/mysql.php");
$geg_summe1_sql = $mysql->prepare("SELECT SUM(s2_ergebnis) AS value_sum_geg FROM eingaben WHERE spieler1 = :userid AND season= :season AND gespielt= 2 AND liga = :liga");
$geg_summe1_sql->bindParam(":userid", $userid);
$geg_summe1_sql->bindParam(":season", $season);
$geg_summe1_sql->bindParam(":liga", $liga);
$geg_summe1_sql->execute();
$geg_summe1 = $geg_summe1_sql->fetch(PDO::FETCH_ASSOC);
require("./asset/mysql.php");
$geg_summe2_sql = $mysql->prepare("SELECT SUM(s1_ergebnis) AS value_sum_geg2 FROM eingaben WHERE spieler2 = :userid AND season= :season AND gespielt= 2 AND liga = :liga");
$geg_summe2_sql->bindParam(":userid", $userid);
$geg_summe2_sql->bindParam(":season", $season);
$geg_summe2_sql->bindParam(":liga", $liga);
$geg_summe2_sql->execute();
$geg_summe2 = $geg_summe2_sql->fetch(PDO::FETCH_ASSOC);
$geg_summe = $geg_summe1['value_sum_geg'] + $geg_summe2['value_sum_geg2'];
$gesamt = $summe - $geg_summe;
return $gesamt;
}