From a502cc76f7e1e6701ac1c481bb44e01626038ad3 Mon Sep 17 00:00:00 2001 From: mauirixxx Date: Sun, 21 May 2017 23:00:41 -1000 Subject: [PATCH] breaking and entering gw-pull is sort of broken right now. maybe a 3rd inner join will fix it? --- gw-insert.php | 6 +++++- gw-pull.php | 2 +- gw-record.php | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gw-insert.php b/gw-insert.php index 70bd243..b15c811 100644 --- a/gw-insert.php +++ b/gw-insert.php @@ -5,9 +5,13 @@ $con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME); $gold = mysqli_real_escape_string($con, $_POST['droppedgold']); //how much gold dropped $droptype = mysqli_real_escape_string($con, $_POST['droptype']); //this dictates if the drop was a weapon/rune/material $locid = mysqli_real_escape_string($con, $_POST['location']); //this is `treasurelocation`.`treasureid` in the database +$toonid = mysqli_real_escape_string($con, $_POST['chartoon']; //this is the id of the character doing the hunting if ($droptype == 1){ $rarity = mysqli_real_escape_string($con, $_POST['rare']); - echo 'a '. $rarity . ' drop was a weapon!
'; + $req = mysqli_real_escape_string($con, $_POST['requirement']); + $attrib = mysqli_real_escape_string($con, $_POST['attribute']; + $weap = mysqli_real_escape_string($con, $_POST['weapon']); + echo 'SQL code to run: "INSERT INTO `history` (historydate, charnameid, locationid, goldrec, itemreq, itemtype, itemattribute, itemrarity, itemname) VALUES (\'$variable-date-of-treasure\', ' . $toonid . ', ' . $locid . ', ' . $gold . ', ' . $req . ', ' . $weap . ', '$variable-attribute-of-weapon', '$variable-rarity-of-weapon', '$variable-name-of-weapon');"'; } else if ($droptype == 2){ echo 'drop was a rare material!
'; } else if ($droptype == 3){ diff --git a/gw-pull.php b/gw-pull.php index 6af5d10..3f1868e 100644 --- a/gw-pull.php +++ b/gw-pull.php @@ -20,7 +20,7 @@ if (mysqli_num_rows($result) > 0) { echo 'a ' . $row['itemtype'] . ' of ' . $row['runetype']; } else { if (is_null($row['material'])) { - echo 'a ' . $row['itemrarity'] . ' r' . $row['itemreq'] . ' ' . $row['itemattribute'] . ' ' . $row['itemtype'] . ' named something stupid'; + echo 'a ' . $row['itemrarity'] . ' r' . $row['itemreq'] . ' ' . $row['itemattribute'] . ' ' . $row['itemtype'] . ' named ' . $row['itemname'] . ''; //itemtype changed, need to convert itemtype to something readable } else { echo 'a ' . $row['material']; } diff --git a/gw-record.php b/gw-record.php index b5483eb..730656e 100644 --- a/gw-record.php +++ b/gw-record.php @@ -71,9 +71,10 @@ if ($whatdropped == "1"){ $weapon = $row['weapontype']; echo ''; } - echo ''; + echo ' called the '; echo ' and gold pieces.'; echo ''; + echo ''; echo '

'; } else if ($whatdropped == "2"){ echo '
';