私は、ブラウザの URL p で変数を取得し、変数 p に一致するものについて列のプレーヤー名をクエリするスクリプトを作成しようとしていますが、それでも機能しません。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Admin Panel</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="http://example.com/assets/css/bootstrap.css" rel="stylesheet">
<link href="http://example.com/assets/css/docs.css" rel="stylesheet">
<link href="http://example.com/assets/js/google-code-prettify/prettify.css" rel="stylesheet">
<center>
<?php
$con = mysql_connect("","","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("log", $con);
$plyr=$_GET["p"];
$result = mysql_query('SELECT * FROM logs_chat WHERE playername="$plyr"');
echo '
<table class="table">
<thead>
<tr>
<th>Time</th>
<th>Player</th>
<th>Message</th>
</tr>
</thead>
<tbody>
';
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['time'] . "</td>";
echo "<td>" . $row['playername'] . "</td>";
echo "<td>" . $row['text'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
</center>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<script src="http://example.com/assets/js/jquery.js"></script>
<script src="http://example.com/assets/js/google-code-prettify/prettify.js"></script>
<script src="http://example.com/assets/js/bootstrap-transition.js"></script>
<script src="http://example.com/assets/js/bootstrap-alert.js"></script>
<script src="http://example.com/assets/js/bootstrap-modal.js"></script>
<script src="http://example.com/assets/js/bootstrap-dropdown.js"></script>
<script src="http://example.com/assets/js/bootstrap-scrollspy.js"></script>
<script src="http://example.com/assets/js/bootstrap-tab.js"></script>
<script src="http://example.com/assets/js/bootstrap-tooltip.js"></script>
<script src="http://example.com/assets/js/bootstrap-popover.js"></script>
<script src="http://example.com/assets/js/bootstrap-button.js"></script>
<script src="http://example.com/assets/js/bootstrap-collapse.js"></script>
<script src="http://example.com/assets/js/bootstrap-carousel.js"></script>
<script src="http://example.com/assets/js/bootstrap-typeahead.js"></script>
<script src="http://example.com/assets/js/bootstrap-affix.js"></script>
<script src="http://example.com/assets/js/application.js"></script>
</body>
</html>