About 53 results: "mysql_query repo:graywh/utstats"
Page 1 of 3
Filter Results
Sources
Languages
Filter Results
Try Search On
plm.php in utstats https://github.com/graywh/utstats.git | 329 lines | PHP
  1.     
  2.     mysql_query("DELETE FROM uts_pinfo WHERE id = $mplayer2") or die(mysql_error());
  3.     mysql_query("UPDATE uts_player SET pid = $mplayer1  WHERE pid = $mplayer2") or die(mysql_error());
  4.     mysql_query("UPDATE uts_weaponstats SET pid = $mplayer1  WHERE pid = $mplayer2") or die(mysql_error());
  5.     mysql_query("DELETE FROM uts_weaponstats WHERE pid = $mplayer2") or die(mysql_error());
  6.     mysql_query("DELETE FROM uts_weaponstats WHERE matchid='0' AND pid = '$mplayer1'") or die(mysql_error());
  7.     
  8.     $q_weaponstats = mysql_query("SELECT weapon, SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE pid = '$mplayer1'  GROUP BY weapon") or die(mysql_error());
  9.     while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) {
  10.         mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='$mplayer1',  weapon='${r_weaponstats['weapon']}', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error());
  11.     }
  12.     mysql_query("UPDATE uts_match SET firstblood = $mplayer1  WHERE firstblood = $mplayer2") or die(mysql_error());
  13.     mysql_query("UPDATE uts_rank SET pid = $mplayer2 WHERE pid= $mplayer1") or die(mysql_error());
  14.     $sql_nrank = "SELECT SUM(time) AS time, pid, gid, AVG(rank) AS rank, AVG(prevrank) AS prevrank, SUM(matches) AS matches FROM uts_rank WHERE pid = $mplayer2 GROUP BY pid, gid";
  15.     $q_nrank = mysql_query($sql_nrank) or die(mysql_error());











totals.php in utstats https://github.com/graywh/utstats.git | 809 lines | PHP
  1. FROM uts_player AS p, uts_games AS g WHERE p.gid = g.id GROUP BY gamename ORDER BY gamename ASC";
  2. $q_totsumm = mysql_query($sql_totsumm) or die(mysql_error());
  3.     $stat_high = small_query("SELECT @max := $s_formula AS x, SUM(p.gametime) AS sumgametime FROM uts_player AS p ,uts_weaponstats AS ws WHERE ws.pid = p.pid AND ws.matchid = 0 AND ws.weapon = 0 GROUP BY p.pid HAVING sumgametime > 1800 ORDER BY x DESC LIMIT 1");
  4. 	$q_cstat = mysql_query("SELECT p.pid, pi.name, p.country, $s_formula AS stat, SUM(p.gametime) AS sumgametime, COUNT(p.matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi, uts_weaponstats AS ws WHERE ws.pid = pi.id AND p.pid = pi.id AND ws.matchid = 0 AND ws.weapon = 0 AND pi.banned <> 'Y' GROUP BY ws.pid HAVING sumgametime > 1800 AND stat > 0 AND stat = @max ORDER BY pi.name ASC");
  5.     $stat_high = small_query("SELECT @max := max($s_formula) AS x FROM uts_player as p LEFT JOIN uts_weaponstats AS ws ON (ws.pid = p.pid AND ws.matchid = p.matchid AND ws.weapon = 0)");
  6. 	$q_cstat = mysql_query("SELECT COUNT(p.matchid) as times, p.pid, pi.name, p.country, MAX($s_formula) AS stat FROM uts_player AS p, uts_pinfo AS pi, uts_weaponstats AS ws WHERE ws.pid = pi.id AND p.pid = pi.id AND ws.matchid = p.matchid AND ws.weapon = 0 AND pi.banned <> 'Y' AND p.gametime > 60 AND $s_formula > 0 AND $s_formula = @max GROUP BY p.pid ORDER BY times DESC, pi.name ASC");
  7. $sql_mweapons = "SELECT id, name, image FROM uts_weapons WHERE hide <> 'Y' ORDER BY sequence, id ASC";
  8. $q_mweapons = mysql_query($sql_mweapons) or die(mysql_error());
  9. 	$sql_mweaponsl = "SELECT w.pid AS playerid, pi.name AS name, pi.country AS country, SUM(w.kills) as kills, COUNT(DISTINCT w.matchid) AS mcount FROM uts_weaponstats AS w LEFT JOIN uts_pinfo AS pi ON w.pid = pi.id WHERE w.weapon = '$wid' AND w.pid > 0 AND w.matchid <> 0 AND pi.banned <> 'Y' GROUP BY w.pid ORDER BY kills DESC LIMIT 0,1";
  10. 	$q_mweaponsl = mysql_query($sql_mweaponsl) or die(mysql_error());
  11. //$sql_mweapons = "SELECT id, name, image FROM uts_weapons WHERE hide <> 'Y' ORDER BY sequence, id ASC";
  12. $q_mweapons = mysql_query($sql_mweapons) or die(mysql_error());
  13. 	$sql_mweaponsl = "SELECT w.matchid, w.pid AS playerid, pi.name AS name, pi.country AS country, w.kills FROM uts_weaponstats AS w LEFT JOIN uts_pinfo AS pi ON w.pid = pi.id WHERE w.weapon = '$wid' AND w.pid > 0 AND w.matchid > 0 AND pi.banned <> 'Y' ORDER BY w.kills DESC LIMIT 0,1";
  14. 	$q_mweaponsl = mysql_query($sql_mweaponsl) or die(mysql_error());









Back to Top