0
I have a little problem,
$alta = $_GET['alt-a'];
$altb = $_GET['alt-b'];
$altc = $_GET['alt-c'];
$altd = $_GET['alt-d'];
$correta = $_GET['correta'];
$img = $_SESSION['imagem'];
$questao = $_SESSION['questao'];
$inserta = mysqli_query($conn,"INSERT INTO alternativas VALUES ($codigo, '$alta', 'a'), ($codigo, '$altb', 'b'), ($codigo, '$altc', 'c'), ($codigo, '$altd', 'd') ");
$insert = mysqli_query($conn,"INSERT INTO questoes VALUES ($codigo, '$questao', '$img', '$correta')");
echo "Questão inserida com sucesso!";
When running this script, in most cases it works normal...but in some cases it does not enter all the information, in some cases it will insert $Insert completely, and $insert will be inserted 4 lines.. sometimes I only insert two, the problem is always in the $insert, sometimes I do not insert all.
How these parameters are sent?
– rray
Some by GET, others by SESSION, but I already put an echo to do the GET test and always receive all, but when recording in the bank sometimes not all.
– Dunga Cardoso
By chance the code is your primary key?
– Marco Souza
This code is the last of the auto increment, an Insert inserts the question....
– Dunga Cardoso