PageRenderTime 52ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/html/import/import_dom.php

https://github.com/graywh/utstats
PHP | 17 lines | 13 code | 2 blank | 2 comment | 2 complexity | 86d8dc0772a71b47442748bca2a7d95f MD5 | raw file
  1. <?php
  2. // Get dom player scores
  3. $sql_domplayer = "SELECT col3 FROM uts_temp_$uid WHERE col1 = 'dom_playerscore_update' AND col2 = $playerid ORDER BY id DESC LIMIT 0,1";
  4. $q_domplayer = mysql_query($sql_domplayer) or die(mysql_error());
  5. $r_domplayer = mysql_fetch_array($q_domplayer);
  6. $domplayer = $r_domplayer[col3];
  7. if ($domplayer == null) $domplayer = 0;
  8. $updatedomplayer = "UPDATE uts_player SET dom_pts = $domplayer WHERE id = $playerecordid";
  9. mysql_query($updatedomplayer) or die(mysql_error());
  10. // Who did the control points
  11. $r_domcp = small_query("SELECT count(id) AS domcpcount FROM uts_temp_$uid WHERE col1 = 'controlpoint_capture' AND col3 = $playerid");
  12. $domcpcount = $r_domcp[domcpcount];
  13. $upd_domcp = "UPDATE uts_player SET dom_cp = $domcpcount WHERE id = $playerecordid";
  14. mysql_query($upd_domcp) or die(mysql_error());
  15. ?>