From a56c50dc1d1b646c83f105bdf84cf1a3097c7bb4 Mon Sep 17 00:00:00 2001 From: mauirixxx Date: Fri, 9 Jun 2017 20:11:23 -1000 Subject: [PATCH] i wonder what I broke should insert a "Nothing dropped!" and 0 gold pieces into the database in the event a player visits a location before the 30 days is up. Also hopefully included a working todays date + 30 days from now date to let the player know when to return again. --- gw-insert.php | 6 ++++++ gw-record.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gw-insert.php b/gw-insert.php index 63198ba..ec77cf0 100644 --- a/gw-insert.php +++ b/gw-insert.php @@ -38,6 +38,12 @@ if ($droptype == 1){ if (!$result = $con->query($sqlruneins)){ die ('There was an error running the query [' . $con->error . ']'); } +} else if ($droptype == 4){ + $itname = mysqli_real_escape_string($con, $_POST['itemname']); + $sqlnothing = "INSERT INTO `history` (historydate, charnameid, locationid, goldrec, itemname) VALUES ('$treasdate', $uid, $toonid, $locid, $gold, '$itname')"; + if (!$result = $con->query($sqlnothing)){ + die ('There was an error running the query [' . $con->error . ']'); + } } else { exit("Variable droptype was set to ($droptype)"); } diff --git a/gw-record.php b/gw-record.php index d0c735d..b455ae5 100644 --- a/gw-record.php +++ b/gw-record.php @@ -124,7 +124,7 @@ if ($whatdropped == "1"){ } else if ($whatdropped == "4"){ echo '
'; echo 'on nothing dropped! Maybe try again in 30 days on the: ' . date('Y-m-d', strtotime("+30 days")); - echo ''; + echo ''; echo ''; echo ''; echo '

';