09.01.2009, 20:37
Код:
$result = mysql_query('SELECT * FROM Users ORDER BY kills DESC'); $i=0; echo "<center>"; echo "Top 15 - Murder Machines:"; echo "<table width='0' border='1' font-size='10' cellpadding='0' align='center'> <tr> <td width='80px' align='left' valign='middle'> <b>Name</b> </td> <td width='80px' align='left' valign='middle'> <b>Kills</b> </td> <td width='80px' align='left' valign='middle'> <b>Deaths</b> </td> <td width='80px' align='left' valign='middle'> <b>Times logged in</b> </td> <td width='80px' align='left' valign='middle'> <b>Messages</b> </td> <td width='80px' align='left' valign='middle'> <b>Level</b> </td>"; while(($row = mysql_fetch_array($result)) AND $i<15) { $i++; echo "<tr><td width='0' align='left' valign='middle'> ". $row['username'] ." </td> <td width='0' align='left' valign='middle'> ". $row['kills'] ." </td> <td width='0' align='left' valign='middle'> ". $row['deaths'] ." </td> <td width='0' align='left' valign='middle'> ". $row['logs'] ." </td> <td width='0' align='left' valign='middle'> ". $row['chats'] ." </td> <td width='0' align='left' valign='middle'> ". $row['level'] ."</td>"; } echo "<tr></table>";