{"id":135,"date":"2017-03-12T20:50:46","date_gmt":"2017-03-12T20:50:46","guid":{"rendered":"http:\/\/www.rogue-operatives.co.uk\/?page_id=135"},"modified":"2017-03-23T22:30:35","modified_gmt":"2017-03-23T22:30:35","slug":"1-2","status":"publish","type":"page","link":"https:\/\/www.rogue-operatives.co.uk\/?page_id=135","title":{"rendered":"Woodenfort Siege Leaderboard"},"content":{"rendered":"<p>[insert_php]<\/p>\n<p>$servername = &#8220;localhost&#8221;;<br \/>\n$username = &#8220;rogue-operatives&#8221;;<br \/>\n$password = &#8220;sim720MYSQL&#8221;;<br \/>\n$dbname = &#8220;rogue_operatives_co_uk&#8221;;<br \/>\n\/\/ Create connection<br \/>\n$conn = new mysqli($servername, $username, $password, $dbname);<br \/>\n\/\/ Check connection<br \/>\nif ($conn->connect_error) {<br \/>\ndie(&#8220;Connection failed: &#8221; . $conn->connect_error);<br \/>\n}<\/p>\n<p>echo &#8220;<\/p>\n<form method='post'>&#8220;;<br \/>\necho &#8220;<b>Deaths: <\/b><font color='black'> <select id='deathfilter' name='deathfilter'>&#8220;;<br \/>\necho &#8220;<option value='1'>1<\/option>&#8220;;<br \/>\necho &#8220;<option value='2'>2<\/option>&#8220;;<br \/>\necho &#8220;<option value='3'>3<\/option>&#8220;;<br \/>\necho &#8220;<option value='4'>4<\/option>&#8220;;<br \/>\necho &#8220;<option value='5'>5<\/option>&#8220;;<br \/>\necho &#8220;<option value='6'>6<\/option>&#8220;;<br \/>\necho &#8220;<\/select> &nbsp; &nbsp;&#8220;;<br \/>\necho &#8220;<button type='submit' value='deathfilter'>Show Results<\/button>&#8220;;<br \/>\necho &#8220;<\/br><\/font>&#8220;;<br \/>\necho &#8220;<\/br>&#8220;;<\/p>\n<p>$deathfilter = $_POST[&#8216;deathfilter&#8217;];<br \/>\n$sql = &#8220;SELECT * FROM siegeleaderboard WHERE map= &#8216;Woodenfort Siege&#8217; AND deathvalue= &#8216;$deathfilter&#8217; ORDER BY killsvalue DESC LIMIT 100&#8221;;<br \/>\n$result = $conn->query($sql) or die($conn->error.__LINE__);<br \/>\n$sqlelse = &#8220;SELECT * FROM siegeleaderboard WHERE map= &#8216;Woodenfort Siege&#8217; ORDER BY killsvalue DESC LIMIT 100&#8221;;<br \/>\n$resultelse = $conn->query($sqlelse) or die($conn->error.__LINE__);<br \/>\n$counter = 1;<\/p>\n<p>if ($result->num_rows > 0) {<\/p>\n<p>echo &#8220;<a href='http:\/\/www.rogue-operatives.co.uk\/?page_id=135'>SHOW ALL SCORES<\/a>&#8220;;<br \/>\necho &#8220;<\/p>\n<table>\n<tr>\n<th>#<\/th>\n<th>Username<\/th>\n<th>Map<\/th>\n<th>Total Kills<\/th>\n<th>Total Deaths<\/th>\n<th>Time Survived<\/th>\n<\/tr>\n<p>&#8220;;<\/p>\n<p>while($row = $result->fetch_assoc()) {<br \/>\necho &#8220;<\/p>\n<tr>&#8220;;<br \/>\necho &#8220;<\/p>\n<td>&#8221; . $counter . &#8220;<\/td>\n<p>&#8220;;<br \/>\necho &#8220;<\/p>\n<td>&#8221; . $row[&#8216;playernamevalue&#8217;] . &#8220;<\/td>\n<p>&#8220;;<br \/>\necho &#8220;<\/p>\n<td>&#8221; . $row[&#8216;map&#8217;] . &#8220;<\/td>\n<p>&#8220;;<br \/>\necho &#8220;<\/p>\n<td>&#8221; . $row[&#8216;killsvalue&#8217;] . &#8220;<\/td>\n<p>&#8220;;<br \/>\necho &#8220;<\/p>\n<td>&#8221; . $row[&#8216;deathvalue&#8217;] . &#8220;<\/td>\n<p>&#8220;;<br \/>\necho &#8220;<\/p>\n<td>&#8221; . $row[&#8216;timeingame&#8217;] . &#8220;<\/td>\n<p>&#8220;;<br \/>\necho &#8220;<\/tr>\n<p>&#8220;;<\/p>\n<p>$counter++;<br \/>\n}<br \/>\necho &#8220;<\/table>\n<p>&#8220;;<\/p>\n<p>} elseif ($resultelse->num_rows > 0) {<\/p>\n<p>echo &#8220;<\/p>\n<table>\n<tr>\n<th>#<\/th>\n<th>Username<\/th>\n<th>Map<\/th>\n<th>Total Kills<\/th>\n<th>Total Deaths<\/th>\n<th>Time Survived<\/th>\n<\/tr>\n<p>&#8220;;<\/p>\n<p>while($row = $resultelse->fetch_assoc()) {<br \/>\necho &#8220;<\/p>\n<tr>&#8220;;<br \/>\necho &#8220;<\/p>\n<td>&#8221; . $counter . &#8220;<\/td>\n<p>&#8220;;<br \/>\necho &#8220;<\/p>\n<td>&#8221; . $row[&#8216;playernamevalue&#8217;] . &#8220;<\/td>\n<p>&#8220;;<br \/>\necho &#8220;<\/p>\n<td>&#8221; . $row[&#8216;map&#8217;] . &#8220;<\/td>\n<p>&#8220;;<br \/>\necho &#8220;<\/p>\n<td>&#8221; . $row[&#8216;killsvalue&#8217;] . &#8220;<\/td>\n<p>&#8220;;<br \/>\necho &#8220;<\/p>\n<td>&#8221; . $row[&#8216;deathvalue&#8217;] . &#8220;<\/td>\n<p>&#8220;;<br \/>\necho &#8220;<\/p>\n<td>&#8221; . $row[&#8216;timeingame&#8217;] . &#8220;<\/td>\n<p>&#8220;;<br \/>\necho &#8220;<\/tr>\n<p>&#8220;;<\/p>\n<p>$counter++;<br \/>\n}<br \/>\n    echo &#8220;<\/table>\n<p>&#8220;;<br \/>\n} else {<br \/>\n    echo &#8220;0 Results&#8221;;<br \/>\n}<br \/>\n$conn->close();<br \/>\n[\/insert_php]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[insert_php] $servername = &#8220;localhost&#8221;; $username = &#8220;rogue-operatives&#8221;; $password = &#8220;sim720MYSQL&#8221;; $dbname = &#8220;rogue_operatives_co_uk&#8221;; \/\/ Create connection $conn = new mysqli($servername, $username, $password, $dbname); \/\/ Check connection if ($conn->connect_error) { die(&#8220;Connection [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page_fullwidth.php","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"_links":{"self":[{"href":"https:\/\/www.rogue-operatives.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/135"}],"collection":[{"href":"https:\/\/www.rogue-operatives.co.uk\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.rogue-operatives.co.uk\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.rogue-operatives.co.uk\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rogue-operatives.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=135"}],"version-history":[{"count":81,"href":"https:\/\/www.rogue-operatives.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/135\/revisions"}],"predecessor-version":[{"id":301,"href":"https:\/\/www.rogue-operatives.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/135\/revisions\/301"}],"wp:attachment":[{"href":"https:\/\/www.rogue-operatives.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}