So I'm a beginner in PHP and I have a question in the following code ... when I click on the remove button it does not remove just the id from the while loop, it removes all, could anyone help me?
<?php
include 'conexao.php';
session_start();
?>
<html>
<head>
</head>
<body>
<h1>CRUD - ALUNOS</h1>
<form action="FrmCadastro.php" method="POST">
<input type="submit" value="+"/>
</form>
<table border="2px">
<th>Aluno</th>
<th>Nota</th>
<th>Turma</th>
<tr></tr>
<?php
$sql = "SELECT * from tbAluno";
$listarAlunos = mysqli_query($conexao, $sql);
while($row = mysqli_fetch_assoc($listarAlunos)){
$id = $row['id'];
$nome = $row['aluno'];
$nota = $row['nota'];
$turma = $row['turma'];
?>
<td>
<?php echo"$nome"?>
</td>
<td>
<?php echo"$nota"?>
</td>
<td>
<?php echo"$turma"?>
</td>
<td>
<form>
<input type="submit" value="remover"/>
<?php
$sql = "DELETE from tbAluno WHERE id = $id";
$removerAluno = mysqli_query($conexao, $sql);
echo $id;
?>
</form>
</td>
<tr></tr>
<?php
}
?>
</table>
</body>
</html>