3
In my code I have 3 buttons, which serve for the user to classify 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 classify the service? The data is being entered without problem, I’m just having problems in how to insert in the field classificacao
.
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');
}
}
Thank you so much! I just hadn’t put anything in
value
because I don’t want any text to appear, but that’s the minimum! Thank you, it worked!– Ana
You can tbm make a checker on
PHP
for this case of not wanting text to appear, if you want I can edit with a way to make this check– Wees Smith
That would be great of you, Wees!
– Ana
Ready @Ana, I edited the answer
– Wees Smith
Thanks Wees, I tried without for anything on
value
however did not give, it only works if there is something insidevalue
– Ana
I solved it with css, now everything is great, thanks again!
– Ana