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 символов.

32 строки
1.1 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";
  9. if (!$result = $con->query($sql)){
  10. die ('There was an error running the query [' . $con->error . ']');
  11. }
  12. if (mysqli_num_rows($result) > 0) {
  13. while ($row = $result->fetch_array()){
  14. echo 'On ' . $row['historydate'] . ', "' . $row['charname'] . '" got ' . $row['goldrec'] . 'GP and ';
  15. if ($row['itemtype'] == "Rune") {
  16. echo 'a ' . $row['itemtype'] . ' of ' . $row['runetype'];
  17. } else {
  18. if (is_null($row['material'])) {
  19. echo 'a ' . $row['itemrarity'] . ' r' . $row['itemreq'] . ' ' . $row['itemattribute'] . ' ' . $row['itemtype'] . ' named something stupid';
  20. } else {
  21. echo 'a ' . $row['material'];
  22. }
  23. }
  24. echo ' at (insert SQL code here) <BR />!';
  25. }
  26. } else {
  27. echo 'no data to display for that character';
  28. }
  29. ?>
  30. <TITLE>Treasure Dates</TITLE>