-1
**The pagination works perfectly, but when I do the following case: I change the pagination everything in good, it gives me a url parameter equal to: localhost/index.php? page=1 if I remove the pagination number and leave only = it gives me an error (Warning: mysqli_num_rows() expects Parameter 1 to be mysqli_result, Boolean Given or while($Row = mysqli_fetch_assoc($resultado_players)){
$pagina = (isset($_GET['pagina']))? $_GET['pagina'] : 1;
$result_player = "SELECT * FROM player";
$resultado_player = mysqli_query($conn, $result_player);
$total_players = mysqli_num_rows($resultado_player);
$quantidade_pg = 3;
$num_pagina = ceil($total_players/$quantidade_pg);
$incio = ($quantidade_pg*$pagina)-$quantidade_pg;
$result_players = "SELECT * FROM player limit $incio, $quantidade_pg";
$resultado_players = mysqli_query($conn, $result_players);
$total_players = mysqli_num_rows($resultado_players);
$sqs = mysqli_query($conn, "SELECT * FROM user WHERE id='1'");
$sql = mysqli_query($conn, "SELECT * FROM config WHERE id='1'");
$sda = mysqli_fetch_assoc($sqs);
$sdl = mysqli_fetch_assoc($sql);
?>
$lim = 1;
$inicio = ((($pagina - $lim) > 1) ? $pagina - $lim : 1);
$fim = ((($pagina+$lim) < $num_pagina) ? $pagina+$lim : $num_pagina);
if($num_pagina > 1 && $pagina <= $num_pagina){
}
?>
<nav class="text-center">
<ul class="pagination">
<li>
<?php
if($pagina_anterior != 0){ ?>
<a href="index.php?pagina=<?php echo $pagina_anterior; ?>" aria-label="Previous">
<span aria-hidden="true"><i class="fas fa-chevron-left"></i></span>
</a>
<?php }else{ ?>
<span aria-hidden="true"><i class="fas fa-chevron-left"></i></span>
<?php } ?>
</li>
<?php
for($i = $inicio; $i <= $fim; $i++){ ?>
<li><a href="index.php?pagina=<?php echo $i; ?>"><?php echo $i; ?></a></li>
<?php } ?>
<li>
<?php
if($pagina_posterior <= $num_pagina){ ?>
<a href="index.php?pagina=<?php echo $pagina_posterior; ?>" aria-label="Previous">
<span aria-hidden="true"><i class="fas fa-chevron-right"></i></span>
</a>
<?php }else{ ?>
<span aria-hidden="true"><i class="fas fa-chevron-right"></i></span>
<?php } ?>
</li>
</ul>
</nav>**
You do not need to edit the question by saying it has been solved. Just the fact that you have accepted an answer already indicates that the problem has been solved.
– hkotsubo