From 5ffee81508f60e8f94dc914efb70b2a01ed856aa Mon Sep 17 00:00:00 2001 From: mauirixxx Date: Thu, 25 May 2017 10:08:03 -1000 Subject: [PATCH] tying characters to logged in user so later on you can pull ALL history from a specific user, instead of just a specific toon, if desired --- gw-insert.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gw-insert.php b/gw-insert.php index 0cdf55d..8b9e9ea 100644 --- a/gw-insert.php +++ b/gw-insert.php @@ -7,6 +7,7 @@ $gold = mysqli_real_escape_string($con, $_POST['droppedgold']); //how much gold $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 = $_SESSION['playerid']; +$uid = $_SESSION['userid']; $treasdate = mysqli_real_escape_string($con, $_POST['treasuredate']); if ($droptype == 1){ $rarity = mysqli_real_escape_string($con, $_POST['rare']); @@ -14,7 +15,7 @@ if ($droptype == 1){ $attrib = mysqli_real_escape_string($con, $_POST['attribute']); $weap = mysqli_real_escape_string($con, $_POST['weapon']); $itname = mysqli_real_escape_string($con, $_POST['itemname']); - $sqlweapins = "INSERT INTO `history` (historydate, charnameid, locationid, goldrec, itemreq, itemtype, itemattribute, itemrarity, itemname) VALUES ('$treasdate', $toonid, $locid, $gold, $req, $weap, $attrib, $rarity, '$itname')"; + $sqlweapins = "INSERT INTO `history` (historydate, userid, charnameid, locationid, goldrec, itemreq, itemtype, itemattribute, itemrarity, itemname) VALUES ('$treasdate', $uid, $toonid, $locid, $gold, $req, $weap, $attrib, $rarity, '$itname')"; if (!$result = $con->query($sqlweapins)){ die ('There was an error running the query [' . $con->error . ']'); }