Преглед изворни кода

doing rune insertion now

need to fix gw-pull as everything is going by id now
development
mauirixxx пре 8 година
родитељ
комит
050e505505
2 измењених фајлова са 5 додато и 1 уклоњено
  1. +4
    -1
      gw-insert.php
  2. +1
    -0
      gw-record.php

+ 4
- 1
gw-insert.php Прегледај датотеку

@@ -6,18 +6,21 @@ $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 $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 $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 $toonid = mysqli_real_escape_string($con, $_POST['chartoon']); //this is the id of the character doing the hunting
$treasdate = mysqli_real_escape_string($con, $_POST['treasuredate']); //
if ($droptype == 1){ if ($droptype == 1){
$rarity = mysqli_real_escape_string($con, $_POST['rare']); $rarity = mysqli_real_escape_string($con, $_POST['rare']);
$req = mysqli_real_escape_string($con, $_POST['requirement']); $req = mysqli_real_escape_string($con, $_POST['requirement']);
$attrib = mysqli_real_escape_string($con, $_POST['attribute']); $attrib = mysqli_real_escape_string($con, $_POST['attribute']);
$weap = mysqli_real_escape_string($con, $_POST['weapon']); $weap = mysqli_real_escape_string($con, $_POST['weapon']);
$itname = mysqli_real_escape_string($con, $_POST['itemname']); $itname = mysqli_real_escape_string($con, $_POST['itemname']);
$treasdate = mysqli_real_escape_string($con, $_POST['treasuredate']);
$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, charnameid, locationid, goldrec, itemreq, itemtype, itemattribute, itemrarity, itemname) VALUES ('$treasdate', $toonid, $locid, $gold, $req, $weap, $attrib, $rarity, '$itname')";
if (!$result = $con->query($sqlweapins)){ if (!$result = $con->query($sqlweapins)){
die ('There was an error running the query [' . $con->error . ']'); die ('There was an error running the query [' . $con->error . ']');
} }
} else if ($droptype == 2){ } else if ($droptype == 2){
$runeid = mysqli_real_escape_string($con, $_POST['runeid'];
$runerare = mysqli_real_escape_string($con, $_POST['runerarity']);
echo "SQL code should be \"INSERT INTO `history` (historydate, charnameid, locationid, goldrec, itemtype, itemrarity, runetype) VALUES ('$treasdate', $toonid, $locid, $gold, '16', $runerare, $runeid\" <BR />";
echo 'drop was a rare material!<BR />'; echo 'drop was a rare material!<BR />';
} else if ($droptype == 3){ } else if ($droptype == 3){
echo 'drop was a rune!<BR />'; echo 'drop was a rune!<BR />';


+ 1
- 0
gw-record.php Прегледај датотеку

@@ -97,6 +97,7 @@ if ($whatdropped == "1"){
} else if ($whatdropped == "3"){ } else if ($whatdropped == "3"){
echo '<FORM METHOD="POST" ACTION="gw-insert.php">'; echo '<FORM METHOD="POST" ACTION="gw-insert.php">';
echo 'on <INPUT NAME="treasuredate" TYPE="DATE" PLACEHOLDER="2006-10-26"> a '; echo 'on <INPUT NAME="treasuredate" TYPE="DATE" PLACEHOLDER="2006-10-26"> a ';
echo '<SELECT NAME=runerarity"><OPTION VALUE="2">Blue</OPTION><OPTION VALUE="3">Purple</OPTION><OPTION VALUE="4">Gold</OPTION> ';
//code for what rune dropped //code for what rune dropped
$sqlrune = "SELECT * FROM `listrunes` ORDER BY `runeid` ASC"; $sqlrune = "SELECT * FROM `listrunes` ORDER BY `runeid` ASC";
if (!$result = $con->query($sqlrune)){ if (!$result = $con->query($sqlrune)){


Loading…
Откажи
Сачувај