AccID Name Money Score Kills Death GC
4 testttttt 50000 0 0 0 0
4 testttttt 50000 0 0 0 0
4 testttttt 50000 0 0 0 0
4 testttttt 50000 0 0 0 0
$query = mysqli_query($con, "SELECT reg_id, name, money, score,kills,bmoney, deaths,cookies FROM `players` ORDER BY reg_id DESC LIMIT 30;");
if(mysqli_num_rows($query) > 0)
{
$row = mysqli_fetch_array($query, MYSQLI_ASSOC);
$id = 0;
while($id < mysqli_num_rows($query))
{
echo "<tr><td>".$row['reg_id']."</td>";
echo "<td>".$row['name']."</td>";
echo "<td>".$row['money']."</td>";
echo "<td>".$row['score']."</td>";
echo "<td>".$row['kills']."</td>";
echo "<td>".$row['deaths']."</td>";
echo "<td>".$row['cookies']."</tr></td>";
$id++;
}
}
else {
echo "<tr><td colspan='6'><small>There ARE NO PLAYERS REGISTERED IN SERVER DATABASE!!!</small></td></tr>";
}
mysqli_free_result($query);
?>
if(mysqli_num_rows($query) > 0) { $id = 0; while($id < mysqli_num_rows($query)) { $row = mysqli_fetch_array($query, MYSQLI_ASSOC); echo "<tr><td>".$row['reg_id']."</td>"; echo "<td>".$row['name']."</td>"; echo "<td>".$row['money']."</td>"; echo "<td>".$row['score']."</td>"; echo "<td>".$row['kills']."</td>"; echo "<td>".$row['deaths']."</td>"; echo "<td>".$row['cookies']."</tr></td>"; $id++; } } else { echo "<tr><td colspan='6'><small>There ARE NO PLAYERS REGISTERED IN SERVER DATABASE!!!</small></td></tr>"; }
Код:
if(mysqli_num_rows($query) > 0) { $id = 0; while($id < mysqli_num_rows($query)) { $row = mysqli_fetch_array($query, MYSQLI_ASSOC); echo "<tr><td>".$row['reg_id']."</td>"; echo "<td>".$row['name']."</td>"; echo "<td>".$row['money']."</td>"; echo "<td>".$row['score']."</td>"; echo "<td>".$row['kills']."</td>"; echo "<td>".$row['deaths']."</td>"; echo "<td>".$row['cookies']."</tr></td>"; $id++; } } else { echo "<tr><td colspan='6'><small>There ARE NO PLAYERS REGISTERED IN SERVER DATABASE!!!</small></td></tr>"; } |