1
This is a part of the code that is not writing in the database. Can help me?
case 'questao':
include "conect.php";
$bd ="questoes";
$banco = mysqli_select_db($conexao,$bd) or (mysqli_error());
$categoria=$_POST["categoria"];
$enunciado=$_POST["enunciado"];
$a=$_POST["1"];
$b=$_POST["2"];
$c=$_POST["3"];
$d=$_POST["4"];
$e=$_POST["5"];
$resposta=$_POST["resposta"];
mysqli_query($conexao, "INSERT INTO perguntas(1,2,3,4,5,categoria,enunciado,resposta)VALUES '$a','$b','$c','$categoria','$d','$e','$enunciado','$resposta' )");
echo "Questoes inseridas com sucesso";
break;
Is there an error message? if you do not change the code to:
mysqli_query($conexao, ' insert .........') or die(mysqli_error($conexao));
– rray
It appears : You have an error in your SQL syntax; check the manual that Corresponds to your Mysql server version for the right syntax to use near '1,2,3,4,5,category,enunciation,response)VALUES ('Sustainability','Biodiversidad' at line 1
– Fernando Junior
Place numbers between single quotes.
– MagicHat
I tried and the same thing came up
– Fernando Junior
I got confused, I think it’s with crase...
– MagicHat
Staff freeze alternating the numbers for letters, it seems that the msql does not accept number as identifier as column but rather It starts with the remaining letters may contain number, only I am sure of that
– Fernando Junior
And what is the purpose of this break?
– MagicHat
ah part of the code I’m implying bang using swtich;
– Fernando Junior