Guild Wars stat tracking The idea behind this is to track multiple characters individual stats as well as account stats.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 

27 lignes
1.1 KiB

  1. <?php
  2. if (isset($_SESSION['userid'])) {
  3. if ($_POST['prefcharid'] == "nopref") {
  4. $ncp = $con->prepare("UPDATE userinfo SET prefcharid = 0, prefcharname = 'No default selected' WHERE userid = ?");
  5. $ncp->bind_param("i", $_SESSION['userid']);
  6. $ncp->execute();
  7. $ncp->close();
  8. $_SESSION['prefcharid'] = "0";
  9. $_SESSION['prefcharname'] = "No default selected";
  10. echo 'Character preference update - no preferred character selected.<br />';
  11. } else {
  12. $scp = $con->prepare("SELECT charid, charname FROM gwchars WHERE charid = ? AND accid = ? AND userid = ?");
  13. $scp->bind_param("iii", $_POST['prefcharid'], $_SESSION['prefaccid'], $_SESSION['userid']);
  14. $scp->execute();
  15. $result = $scp->get_result();
  16. while ($row = $result->fetch_assoc()) {
  17. $uap = $con->prepare("UPDATE userinfo SET prefcharid = ?, prefcharname = ? WHERE userid = ?");
  18. $uap->bind_param("isi", $_POST['prefcharid'], $row['charname'], $_SESSION['userid']);
  19. $uap->execute();
  20. $uap->close();
  21. $_SESSION['prefcharid'] = $row['charid'];
  22. $_SESSION['prefcharname'] = $row['charname'];
  23. }
  24. echo 'Guild Wars preferred character updated! <br />';
  25. }
  26. }
  27. ?>