| @@ -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 */; | |||||
| @@ -7,7 +7,8 @@ if ($con->connect_errno > 0){ | |||||
| die ('Unable to connect to database [' . $db->connect_errno . ']'); | 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 * 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)){ | if (!$result = $con->query($sql)){ | ||||
| die ('There was an error running the query [' . $con->error . ']'); | die ('There was an error running the query [' . $con->error . ']'); | ||||
| } | } | ||||
| @@ -13,11 +13,11 @@ if (!$result = $con->query($sql)){ | |||||
| } */ | } */ | ||||
| //will be changing weblink with GET data to SELECT box with POST data | //will be changing weblink with GET data to SELECT box with POST data | ||||
| echo '<FORM METHOD="POST" NAME="cselect" ACTION="gw-pull.php">'; | echo '<FORM METHOD="POST" NAME="cselect" ACTION="gw-pull.php">'; | ||||
| echo '<SELECT name="cname">'; | |||||
| echo '<SELECT NAME="cname">'; | |||||
| while ($row = $result->fetch_array()){ | while ($row = $result->fetch_array()){ | ||||
| $charid = $row['playerid']; | $charid = $row['playerid']; | ||||
| $charname = $row['charname']; | $charname = $row['charname']; | ||||
| echo '<OPTION VALUE="' . $charname . '">' . $charname . '</OPTION>'; //need to change first charname variable to charid once I work out the SQL query | |||||
| echo '<OPTION VALUE="' . $charid . '">' . $charname . '</OPTION>'; //need to change first charname variable to charid once I work out the SQL query | |||||
| } | } | ||||
| echo '<INPUT TYPE="SUBMIT" VALUE="Choose Toon"></FORM>'; //gw-pull doesn't accept post data yet. or does it? | echo '<INPUT TYPE="SUBMIT" VALUE="Choose Toon"></FORM>'; //gw-pull doesn't accept post data yet. or does it? | ||||
| ?> | ?> | ||||