In my code I have 3 buttons, which serve for the user to sort the service:
<input type="submit" name="verde" class="verde" value="">
<input type="submit" name="amarelo" class="amarelo" value="">
<input type="submit" name="vermelho" class="vermelho" value="">
How do I put in the database, in the table, the "button" that he chose to sort the service? The data is being inserted without problem, I'm just having problems with how to insert into the classificacao
field.
So far I'm doing this:
if (isset($_POST['verde']) || isset($_POST['amarelo']) || isset($_POST['vermelho'])) {
$inserir=mysqli_query($link,"INSERT INTO questionario (pergunta_id, pergunta, hora, idioma, origem, classificacao) VALUES ('','$stringarray','$hora','$lang', '','')");
if (!$inserir) {
echo "Erro ao inserir na tabela.";
} else {
header('location: comentario.php');
}
}