diff --git a/db/gw-treasure-history.sql b/db/gw-treasure-history.sql index 901dca4..b50d0ed 100644 --- a/db/gw-treasure-history.sql +++ b/db/gw-treasure-history.sql @@ -1,29 +1,34 @@ -/*!40101 SET NAMES utf8 */; - -/*!40101 SET SQL_MODE=''*/; - -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -/*Table structure for table `history` */ - -DROP TABLE IF EXISTS `history`; - -CREATE TABLE `history` ( - `historydate` date DEFAULT NULL, - `charname` varchar(19) DEFAULT NULL, - `location` varchar(20) DEFAULT NULL, - `goldrec` int(4) DEFAULT NULL, - `material` varchar(30) DEFAULT NULL, - `itemreq` int(2) DEFAULT NULL, - `itemtype` varchar(13) DEFAULT NULL, - `itemattribute` varchar(15) DEFAULT NULL, - `itemrarity` varchar(6) DEFAULT NULL, - `itemname` varchar(100) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/* +SQLyog Ultimate v12.09 (64 bit) +MySQL - 5.5.52-MariaDB : Database - mauirixxx +********************************************************************* +*/ + +/*!40101 SET NAMES utf8 */; + +/*!40101 SET SQL_MODE=''*/; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*Table structure for table `history` */ + +CREATE TABLE `history` ( + `historydate` date DEFAULT NULL, + `charnameid` int(11) DEFAULT NULL, + `locationid` int(2) DEFAULT NULL, + `goldrec` int(4) DEFAULT NULL, + `material` varchar(30) DEFAULT NULL, + `itemreq` int(2) DEFAULT NULL, + `itemtype` varchar(13) DEFAULT NULL, + `itemattribute` varchar(15) DEFAULT NULL, + `itemrarity` varchar(6) DEFAULT NULL, + `itemname` varchar(100) DEFAULT NULL, + `runetype` varchar(25) DEFAULT NULL COMMENT 'what type of rune is it (clarity, smiting prayers, axe mastery, etc' +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; diff --git a/gw-pull.php b/gw-pull.php index 1b103ce..8fb81a4 100644 --- a/gw-pull.php +++ b/gw-pull.php @@ -7,7 +7,8 @@ if ($con->connect_errno > 0){ die ('Unable to connect to database [' . $db->connect_errno . ']'); } #$sql = "SELECT * FROM `history` WHERE `charname` = '$cnameid' ORDER BY `historydate` ASC"; //old sql statement that works currently -$sql = "SELECT history.*, treasurelocation.* FROM history LEFT OUTER JOIN treasurelocation ON history.`locationid` = treasurelocation.`treasureid` WHERE history.`charname` = '$cnameid' ORDER BY `historydate` ASC"; +#$sql = "SELECT history.*, treasurelocation.* FROM history LEFT OUTER JOIN treasurelocation ON history.`locationid` = treasurelocation.`treasureid` WHERE history.`charname` = '$cnameid' ORDER BY `historydate` ASC"; //round 2 of SQL queries, saving this since it still works +$sql = "SELECT history.*, treasurelocation.*, playername.`playerid`, playername.`charname` FROM ((history INNER JOIN treasurelocation ON history.`locationid` = treasurelocation.`treasureid`) INNER JOIN playername ON history.`charnameid` = playername.`playerid`) WHERE history.`charnameid` = '$cnameid' ORDER BY `historydate` ASC"; if (!$result = $con->query($sql)){ die ('There was an error running the query [' . $con->error . ']'); } diff --git a/gw-toon.php b/gw-toon.php index 6afa391..3c46ec2 100644 --- a/gw-toon.php +++ b/gw-toon.php @@ -13,11 +13,11 @@ if (!$result = $con->query($sql)){ } */ //will be changing weblink with GET data to SELECT box with POST data echo '
'; -echo ''; while ($row = $result->fetch_array()){ $charid = $row['playerid']; $charname = $row['charname']; - echo ''; //need to change first charname variable to charid once I work out the SQL query + echo ''; //need to change first charname variable to charid once I work out the SQL query } echo '
'; //gw-pull doesn't accept post data yet. or does it? ?> \ No newline at end of file