bugfixes for game stats

This commit is contained in:
Mark Vejvoda 2013-10-31 04:25:08 +00:00
parent 2f197aa8aa
commit 152bbd9bb0
1 changed files with 5 additions and 5 deletions

View File

@ -22,11 +22,11 @@
define( 'DB_LINK', db_connect() );
$gameUUID = (string) clean_str( $_GET['gameUUID'] );
$whereClause = 'gameUUID=\'' . mysql_real_escape_string( $gameUUID ) . '\';';
$whereClause = 'gameUUID=\'' . mysql_real_escape_string( $gameUUID ) . '\'';
$stats_in_db = @mysql_query( 'SELECT COUNT(*) FROM glestgamestats WHERE ' . $whereClause );
$stats_in_db = @mysql_query( 'SELECT COUNT(*) FROM glestgamestats WHERE ' . $whereClause . ';' );
$statsCount = @mysql_fetch_row( $stats_in_db );
$player_stats_in_db = @mysql_query( 'SELECT COUNT(*) FROM glestgameplayerstats WHERE ' . $whereClause );
$player_stats_in_db = @mysql_query( 'SELECT COUNT(*) FROM glestgameplayerstats WHERE ' . $whereClause . ';');
$player_statsCount = @mysql_fetch_row( $player_stats_in_db );
@ -73,7 +73,7 @@
'totalEndGameConcurrentUnitCount=\'' . mysql_real_escape_string( $totalEndGameConcurrentUnitCount ) . '\', ' .
'isHeadlessServer=\'' . mysql_real_escape_string( $isHeadlessServer ) . '\', ' .
'lasttime=' . 'now()' . ' ' .
'WHERE ' . $whereClause);
'WHERE ' . $whereClause . ';');
if (!$result) {
die('part 1a: Invalid query: ' . mysql_error());
@ -199,7 +199,7 @@
'quitBeforeGameEnd=' . $quitBeforeGameEnd . ', ' .
'quitTime=' . $quitTime . ', ' .
'lasttime=' . 'now()' . ' ' .
'WHERE ' . $whereClause);
'WHERE ' . $whereClause . ' AND factionIndex = ' . $factionIndex . ';');
if (!$result) {
die('part 1b: Invalid query: ' . mysql_error());