I need to insert into the database variables that are in a php array, I typed the catch:
for ($i=1; $i <= 20 ; $i++) {
$sqlp= "INSERT INTO pergunta$i (pergunta, opcao1, valor1, opcao2, valor2, opcao3, valor3, opcao4, valor4, opcao5, valor5, opcao6, valor6, opcao7, valor8, opcao2, valor8) VALUES ('$tabela[$i][1]','$tabela[$i][2]','$tabela[$i][3]','$tabela[$i][4]','$tabela[$i][5]','$tabela[$i][6]','$tabela[$i][7]','$tabela[$i][8]','$tabela[$i][9]','$tabela[$i][10]','$tabela[$i][11]','$tabela[$i][12]','$tabela[$i][13]','$tabela[$i][14]','$tabela[$i][15]','$tabela[$i][16]','$tabela[$i][17]',)";
$salvar= mysqli_query($conexao, $sqlp);
}
When executed, the browser returns conversion error from array to string, how can I solve it?