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'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

31 satır
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'] . '!<BR />';
  17. } else {
  18. if (is_null($row['material'])) {
  19. echo 'a ' . $row['itemrarity'] . ' r' . $row['itemreq'] . ' ' . $row['itemattribute'] . ' ' . $row['itemtype'] . ' named something stupid <BR />';
  20. } else {
  21. echo 'a ' . $row['material'] . '!<BR />';
  22. }
  23. }
  24. }
  25. } else {
  26. echo 'no data to display for that character';
  27. }
  28. ?>
  29. <TITLE>Treasure Dates</TITLE>