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.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

34 行
1.5 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";
  11. if (!$result = $con->query($sql)){
  12. die ('There was an error running the query [' . $con->error . ']');
  13. }
  14. if (mysqli_num_rows($result) > 0) {
  15. while ($row = $result->fetch_array()){
  16. echo 'On ' . $row['historydate'] . ', "' . $row['charname'] . '" got ' . $row['goldrec'] . 'GP and ';
  17. if ($row['itemtype'] == "Rune") {
  18. echo 'a ' . $row['itemtype'] . ' of ' . $row['runetype'];
  19. } else {
  20. if (is_null($row['material'])) {
  21. echo 'a ' . $row['itemrarity'] . ' r' . $row['itemreq'] . ' ' . $row['itemattribute'] . ' ' . $row['itemtype'] . ' named something stupid';
  22. } else {
  23. echo 'a ' . $row['material'];
  24. }
  25. }
  26. echo ' at <A HREF="' . $row['wikilink'] . '">' . $row['location'] . '</A><BR />';
  27. }
  28. } else {
  29. echo 'no data to display for that character';
  30. }
  31. ?>
  32. <BODY>
  33. <BR />
  34. Return to <A HREF=gw-toon.php">character selection</A> page