Posted By

Anomaly25 on 08/14/06


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vali29


MySQL


 / Published in: PHP
 

  1. function updateKillPoints($PlayerID) {
  2. $TKP = 0;
  3. $result = mysql_query("SELECT `KillID` FROM `Involved` WHERE `PlayerID` = '".$PlayerID."'");
  4.  
  5. while($data = mysql_fetch_array($result)) {
  6. $KillID = $data['KillID'];
  7.  
  8. $get_result = mysql_query("SELECT `ShipID` FROM `Kill` WHERE `KillID` = '".$KillID."'");
  9.  
  10. while($get_kills = mysql_fetch_array($get_result)) {
  11. $ShipID = $get_kills['ShipID'];
  12.  
  13. $get_points = mysql_query("SELECT `Points` FROM `Ship` WHERE `ShipID` = '".$ShipID."'");
  14.  
  15. while($get_points = mysql_fetch_array($get_points)) {
  16. $TKP = $TKP + $get_points;
  17. }
  18. }
  19. }
  20.  
  21. echo $TKP;
  22. #mysql_query("UPDATE Player SET KillPoints = ".$TKP." WHERE PlayerID = ".$PlayerID."");
  23. }

Report this snippet  

You need to login to post a comment.