if ($_SERVER['REQUEST_METHOD'] == "POST") { if ($_POST['operation'] == "enterMatchStats") { echo "
"; $sql = new SQL(); $sql->connect('kok_ncsl3'); $result = $sql->query("SELECT gid, home_tid, away_tid FROM game WHERE gid = {$_POST['gid']}"); while ($row = mysql_fetch_array($result)) { $hometeam = $row['home_tid']; $awayteam = $row['away_tid']; } ?> query("SELECT pid, name FROM player WHERE tid = {$hometeam}"); echo mysql_error(); $counter = 0; while($row = mysql_fetch_array($result)) { ?> "; ?>
Rounds Won
Username Played Rounds Played Kills Deaths
query("SELECT pid, tid, name FROM player WHERE tid = {$awayteam}"); while($row = mysql_fetch_array($result)) { ?>
Rounds Won
Username Played Rounds played Kills Deaths
";
			echo print_r($_POST);
			echo "
"; setTeamStats($_POST['gid'], $_POST['home_score'], $_POST['away_score']); error_reporting(E_ALL); /*foreach ($_POST['home_pids'] as $index => $pid) { if ($_POST['home_played'][$index] == "played") { setPlayerStats($_POST['gid'], $pid, $_POST['home_rounds'][$index], $_POST['home_kills'][$index], $_POST['home_deaths'][$index]); } } foreach ($_POST['away_pids'] as $index => $pid) { if ($_POST['away_played'][$index] == "played") { setPlayerStats($_POST['gid'], $pid, $_POST['away_rounds'][$index], $_POST['away_kills'][$index], $_POST['away_deaths'][$index]); } }*/ foreach ($_POST['home_played'] as $index) { if ($_POST['home_played'][$index] == "played") { setPlayerStats($_POST['gid'], $_POST['home_pids'][$index], $_POST['home_rounds'][$index], $_POST['home_kills'][$index], $_POST['home_deaths'][$index]); } } foreach ($_POST['away_played'] as $index) { if ($_POST['away_played'][$index] == "played") { setPlayerStats($_POST['gid'], $_POST['away_pids'][$index], $_POST['away_rounds'][$index], $_POST['away_kills'][$index], $_POST['away_deaths'][$index]); } } echo "Player stats added successfully."; } }