<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/wp-load.php');
global $wpdb;
$query = $wpdb->get_results("SELECT * FROM stats_players ORDER BY logins LIMIT 10");
// $results = $query;
$num_results = $wpdb->get_row($results);
$ranking = 1;
?>
<table class="gradienttable">
<tr>
<th>Позиція</th>
<th>Гравець</th>
<th>Входів</th>
</tr>
<?php
while($row = mysqli_fetch_assoc($results)){
$name = $row[`name`];
$logins = $row[`logins`];
?>
<tr>
<td><?php echo $ranking; ?></td>
<td><?php echo $row[`name`]; ?></td>
<td><?php echo $row[`logins`]; ?></td>
<?php
$ranking = $ranking + 1; /* INCREMENT RANKING BY 1 */
?>
</tr>
<?php
} /* END OF WHILE LOOP */
?>
</table>
<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/wp-load.php');
global $wpdb;
$results = $wpdb->get_results("SELECT * FROM stats_players ORDER BY logins LIMIT 10");
?>
<table class="gradienttable">
<tr>
<th>Позиція</th>
<th>Гравець</th>
<th>Входів</th>
</tr>
<?php foreach ($results as $i=>$row) { ?>
<tr>
<td><?= $i+1 ?></td>
<td><?= $row['name'] ?></td>
<td><?= $row['logins'] ?></td>
</tr>
<?php } ?>
</table>