Just a web script to help track when, where, and what you got from the free treasures scattered about Nightfall in the game Guild Wars.
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

35 linhas
1.9 KiB

  1. <TITLE>Treasure Data</TITLE>
  2. <?php
  3. include_once 'gw-connect.php';
  4. $con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
  5. $cnameid = mysqli_real_escape_string($con, $_POST['cname']); //need to sanitize this input somehow
  6. if ($con->connect_errno > 0){
  7. die ('Unable to connect to database [' . $db->connect_errno . ']');
  8. }
  9. #$sql = "SELECT * FROM `history` WHERE `charname` = '$cnameid' ORDER BY `historydate` ASC"; //old sql statement that works currently
  10. #$sql = "SELECT history.*, treasurelocation.* FROM history LEFT OUTER JOIN treasurelocation ON history.`locationid` = treasurelocation.`treasureid` WHERE history.`charname` = '$cnameid' ORDER BY `historydate` ASC"; //round 2 of SQL queries, saving this since it still works
  11. $sql = "SELECT history.*, treasurelocation.*, playername.`playerid`, playername.`charname` FROM ((history INNER JOIN treasurelocation ON history.`locationid` = treasurelocation.`treasureid`) INNER JOIN playername ON history.`charnameid` = playername.`playerid`) WHERE history.`charnameid` = '$cnameid' ORDER BY `historydate` ASC";
  12. if (!$result = $con->query($sql)){
  13. die ('There was an error running the query [' . $con->error . ']');
  14. }
  15. if (mysqli_num_rows($result) > 0) {
  16. while ($row = $result->fetch_array()){
  17. echo 'On ' . $row['historydate'] . ', "' . $row['charname'] . '" got ' . $row['goldrec'] . 'GP and ';
  18. if ($row['itemtype'] == "Rune") {
  19. echo 'a ' . $row['itemtype'] . ' of ' . $row['runetype'];
  20. } else {
  21. if (is_null($row['material'])) {
  22. echo 'a ' . $row['itemrarity'] . ' r' . $row['itemreq'] . ' ' . $row['itemattribute'] . ' ' . $row['itemtype'] . ' named something stupid';
  23. } else {
  24. echo 'a ' . $row['material'];
  25. }
  26. }
  27. echo ' at <A HREF="' . $row['wikilink'] . '">' . $row['location'] . '</A><BR />';
  28. }
  29. } else {
  30. echo 'no data to display for that character';
  31. }
  32. ?>
  33. <BODY>
  34. <BR />
  35. Return to <A HREF="gw-toon.php">character selection</A> page