Dear colleagues.
I am bringing two questions from the Mysql bank, from which the user will register their questions. See:
....
<input type="hidden" name="Pergunta[]" value="<?php echo $idPergunta; ?>">
Pergunta: <?php echo $jmPerguntas->Perguntas; ?><br>
Resposta: <input type="text" name="Respostas[]" class="formRespostas">
....
To retrieve the value of the answer I'm using the foreach, but how do I know which answer refers to which question?
foreach($respostas as $resposta){
$sqlCadastrar = mysqli_query($conexao, "INSERT INTO respostas VALUES(null,".$pergunta.",".$usuario.",'".$resposta."',NOW())");
}