Header aus Schleife entfernen.
Gehen Sie folgendermaßen vor:
<?php
require_once 'header.php';
// Send variables for the MySQL database class.
$database = mysql_connect('localhost', 'root', 'password') or die('Could not connect: ' . mysql_error());
mysql_select_db('robinsnest') or die('Could not select database');
$query = "SELECT * FROM `members` ORDER by `quiz_score` DESC LIMIT 10";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
$num_results = mysql_num_rows($result);
echo "<table>
<tr>
<th>Position</th>
<th>User Name</th>
<th>Score</th>
</tr>";
for($i = 1; $i <= $num_results; $i++)
{
$row = mysql_fetch_array($result);
echo "<tr>
<td>".$i."</td>
<td>".$row['user']."</td>
<td>".$row['quiz_score']."</td>
</tr>";
}
echo "</table>";
echo '<footer>
<p class="pull-right"><a href="#">Back to top</a></p>
<p>© 2014 Company, Inc. · <a href="#">Privacy</a> · <a href="#">Terms</a></p>
</footer>';
?>
Lassen Sie mich wissen, wenn Sie weitere Hilfe benötigen !!