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.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

33 rader
1.4 KiB

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