I have 2 arrays in PHP that come from a form $_POST['qtd']
and $_POST['ing']
:
array(2) { [0]=> string(1) "1" [1]=> string(1) "2" }
array(2) { [0]=> string(1) "a" [1]=> string(1) "b" }
How can you put them together in a variable that is like this?
$variavel = "(1,'a'), (2,'b')";
With this I will make a INSERT
in the MYSQL table that should look like this:
INSERT INTO tabela (qtd, ing) VALUES (1,'a'), (2,'b');