I'm doing a page where it shows the rankings of users with more X and Y, everything is shown inside the site in a table where there is the name of each user and the amount of X he has, but I do not know how to put for example: 1 or 1. Robson 100 (Diamonds), ie I can not put the first column with the settings, to select the users and to show how much each one has I got, all that is left is to insert the settings.
<?php
# conectare la base de datos
require ('../../global.php');
$action = (isset($_REQUEST['action'])&& $_REQUEST['action'] !=NULL)?$_REQUEST['action']:'';
if($action == 'ajax'){
require ('../../hk/pagination.php'); //incluir el archivo de paginación
//las variables de paginación
$page = (isset($_REQUEST['page']) && !empty($_REQUEST['page']))?$_REQUEST['page']:1;
$per_page = 10; //la cantidad de registros que desea mostrar
$adjacents = 4; //brecha entre páginas después de varios adyacentes
$offset = ($page - 1) * $per_page;
//Cuenta el número total de filas de la tabla*/
$count_query = $link->query("SELECT count(*) AS numrows FROM usuarios ");
if ($row= mysqli_fetch_array($count_query)){$numrows = $row['numrows'];}
$total_pages = ceil($numrows/$per_page);
$reload = 'rank.php';
//consulta principal para recuperar los datos
$query = $link->query("SELECT * FROM usuarios order by diamantes DESC LIMIT $offset,$per_page");
if ($numrows>0){
?>
<table class="table table-striped table-hover ">
<thead>
<tr>
<th>Colocação</th>
<th><?php echo $lang[27]; ?></th>
<th>Diamantes</th>
</tr>
</thead>
<tbody>
<?php
while($row = mysqli_fetch_array($query)){
?>
<tr>
<td>NESSA LINHA NO ANTIGO CODIGO (De onde copiei) Ficaria o ID do usuário, porém gostaria de por a colocação</td>
<td><?php echo "$row[username]"; ?></td>
<td><?php echo "$row[diamantes]"; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<div class="table-pagination pull-right">
<?php echo paginate($reload, $page, $total_pages, $adjacents);?>
</div>
<?php
} else {
?>
<div class="alert alert-warning alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo $lang[195]; ?>
</div>
<?php
}
}
?>