From d9e981ec2fd2c092ec6a72a2a0c739aad8b0636c Mon Sep 17 00:00:00 2001 From: mauirixxx Date: Tue, 23 May 2017 12:23:41 -1000 Subject: [PATCH] prepping toon selection --- gw-pull.php | 2 -- gw-toon.php | 21 ++++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/gw-pull.php b/gw-pull.php index f2129d8..0c42c77 100644 --- a/gw-pull.php +++ b/gw-pull.php @@ -7,8 +7,6 @@ $cnameid = mysqli_real_escape_string($con, $_POST['cname']); //need to sanitize 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"; //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 d78f927..92a6a44 100644 --- a/gw-toon.php +++ b/gw-toon.php @@ -1,6 +1,8 @@ connect_errno > 0){ die ('Unable to connect to database [' . $db->connect_errno . ']'); } @@ -8,12 +10,17 @@ $sql = "SELECT playerid, charname FROM `playername` WHERE `userid` = '1' ORDER B if (!$result = $con->query($sql)){ die ('There was an error running the query [' . $con->error . ']'); } -echo '
'; -echo ''; + while ($row = $result->fetch_array()){ + $charid = $row['playerid']; + $charname = $row['charname']; + echo ''; + } + echo '
'; } -echo ''; ?> \ No newline at end of file