I'm using this query to know how many comments a user has made:
$comentarios = $pdo->query("SELECT * FROM topicos_comentarios WHERE autor='".$ver['autor']."'")->rowCount();
However, I would like to know what his position in the overall ranking was, I ran a test and was able to list all users and their positions with this code:
<?php
include 'assets/php/config.php';
$ranking = $pdo->query("SELECT * FROM topicos_comentarios GROUP BY autor ORDER BY count(autor) DESC");
$i = 1;
while($ver = $ranking->fetch(PDO::FETCH_ASSOC)){
$comentarios = $pdo->query("SELECT * FROM topicos_comentarios WHERE autor='".$ver['autor']."'")->rowCount();
?>
<?php echo $i; ?>°- <?php echo $ver['autor'];?> - <?php echo $comentarios; ?></br>
<?php ++$i; } ?>
But how could I get this position individually?