-1
The error is in the code snippet where there is the $update variable below.
I use Mysql and have this table and the goal is to show in an html table the totalranking points. When someone earns points I always get the points in the ranking and when they lose, the points in menosranking are assigned. So in table html I ask to show totalranking that would be "totalranking = the ranking - menosranking". So far so good. But note that totalranking only lives outdated, so I did in PHP something for it to update the entire column totalranking every time someone entered the page, but it only worked once and this update does not happen when someone accesses the page. The code is this:
table class="table table-striped">
<thead>
<tr>
<th scope="col">Posição</th>
<th scope="col">Nome</th>
<th scope="col">Pontuação</th>
</tr>
</thead>
<?php
$atualiza = mysqli_query($conexao, "UPDATE 'login_usuario' SET 'totalranking' = ranking - menosranking"); //deveria atualizar o banco de dados
$query = mysqli_query($conexao, "SELECT usuario, totalranking FROM login_usuario ORDER BY totalranking DESC LIMIT 10");
$lista = 0;
while ($tabela = mysqli_fetch_array($query)) {
$lista++;
?>
<tbody class="table-striped">
<tr>
<th scope="row"><?php echo $lista; ?></th>
<td><?php echo $tabela['usuario']; ?></td>
<td><?php echo $tabela['totalranking']; ?></td>
</tr>
</tbody>
<?php } ?>
</table>
grateful,