bugfixes for game stats
This commit is contained in:
parent
2f197aa8aa
commit
152bbd9bb0
|
@ -22,11 +22,11 @@
|
||||||
define( 'DB_LINK', db_connect() );
|
define( 'DB_LINK', db_connect() );
|
||||||
|
|
||||||
$gameUUID = (string) clean_str( $_GET['gameUUID'] );
|
$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 );
|
$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 );
|
$player_statsCount = @mysql_fetch_row( $player_stats_in_db );
|
||||||
|
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@
|
||||||
'totalEndGameConcurrentUnitCount=\'' . mysql_real_escape_string( $totalEndGameConcurrentUnitCount ) . '\', ' .
|
'totalEndGameConcurrentUnitCount=\'' . mysql_real_escape_string( $totalEndGameConcurrentUnitCount ) . '\', ' .
|
||||||
'isHeadlessServer=\'' . mysql_real_escape_string( $isHeadlessServer ) . '\', ' .
|
'isHeadlessServer=\'' . mysql_real_escape_string( $isHeadlessServer ) . '\', ' .
|
||||||
'lasttime=' . 'now()' . ' ' .
|
'lasttime=' . 'now()' . ' ' .
|
||||||
'WHERE ' . $whereClause);
|
'WHERE ' . $whereClause . ';');
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
die('part 1a: Invalid query: ' . mysql_error());
|
die('part 1a: Invalid query: ' . mysql_error());
|
||||||
|
@ -199,7 +199,7 @@
|
||||||
'quitBeforeGameEnd=' . $quitBeforeGameEnd . ', ' .
|
'quitBeforeGameEnd=' . $quitBeforeGameEnd . ', ' .
|
||||||
'quitTime=' . $quitTime . ', ' .
|
'quitTime=' . $quitTime . ', ' .
|
||||||
'lasttime=' . 'now()' . ' ' .
|
'lasttime=' . 'now()' . ' ' .
|
||||||
'WHERE ' . $whereClause);
|
'WHERE ' . $whereClause . ' AND factionIndex = ' . $factionIndex . ';');
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
die('part 1b: Invalid query: ' . mysql_error());
|
die('part 1b: Invalid query: ' . mysql_error());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user