これを行う方法を思い出せません。データベース内のテーブルからすべてのエントリを取得して、それを html テーブルにリストしようとしています。また、テーブルから取得するエントリの数を 10 ~ 20 に制限しようとしています。
//Connection Info
include('data.php');
//Query To Pull Data
$sql = mysql_query("select name, death, model, humanity, hkills, bkills, kills, hs, late, ldrank, stime, survival, lastupdate from $stats order by kills limit 10");
//Data Pulled To Be Displayed
while ($row = mysql_fetch_array($sql)) {
//Username
$name = $row['name'];
//Deaths
$death = $row['death'];
//Amount of Humanity
$humanity = $row['humanity'];
//Player Type
$model = $row['model'];
//Murders
$murder = $row['hkills'];
//Bandit Kills
$bandit = $row['bkills'];
//Zombie Kills
$zombie = $row['kills'];
//Head Shots
$head = $row['hs'];
//Unknown
$late = $row['late'];
//Unknown
$ldrank = $row['ldrank'];
//Unknown
$stime = $row['stime'];
//Time Survived
$survival = $row['survival'];
//Last Time Player Was On
$update = $row['lastupdate'];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table width="1000" border="1">
<tr>
<th scope="col">Username</th>
<th scope="col">Type</th>
<th scope="col">Friendliness</th>
<th scope="col">Deaths</th>
<th scope="col">Murders</th>
<th scope="col">Bandit Kills</th>
<th scope="col">Zombie Kills</th>
<th scope="col">Head Shots</th>
<th scope="col">Late</th>
<th scope="col">STime</th>
<th scope="col">Time Survived</th>
<th scope="col">LDRank</th>
<th scope="col">Last Played</th>
</tr>
<tr>
<td><? echo "$name"; ?></td>
<td><? echo "$model"; ?></td>
<td><? echo "$humanity"; ?></td>
<td><? echo "$death"; ?></td>
<td><? echo "$murder"; ?></td>
<td><? echo "$bandit"; ?></td>
<td><? echo "$zombie"; ?></td>
<td><? echo "$head"; ?></td>
<td><? echo "$late"; ?></td>
<td><? echo "$ldrank"; ?></td>
<td><? echo "$stime"; ?></td>
<td><? echo "$survival"; ?></td>
<td><? echo "$update"; ?></td>
</tr>
</table>
</body>
</html>