1
How do I update more than one record, for example appears on the page notes.php the following information:
This information is from a bank, so are different ids each student.
My problem is when I click the save button, because when I click it only saves the last item. What can I do in this case?
Code used
<form method="GET" action="notas.php">
<input type='text' placeholder='Nota' name='nota' id='nota' value=" .$linha['nota_valori'] . ">
<button type="submit">Salvar</button>
</form>
In the notes.php has:
$id = $_POST['id'];
$nota = $_POST['nota'];
$sql="UPDATE `nota` SET nota_valori='$nota' WHERE nota_id=$id";
$executa= mysql_query($sql,$con) or die(mysql_error());
echo "Registro salvo com sucesso";
Can you post the code? It’s easier to help.
– Lucas Brogni
Enter html and php code
– Andrei Coelho
The code is on top
– Daniel Alencar Souza