Have duplicate arrays
produto[] valor[] qtd[] total[]
produto[] valor[] qtd[] total[]
I need to save these arrays in an insert, like this:
INSERT 'tabela' (produto, valor, qtd, total) VALUES (produto[],valor[],qtd[],total[]) ;
INSERT 'tabela' (produto, valor, qtd, total) VALUES (produto[],valor[],qtd[],total[]) ;
// NOTE: I know this in VALUES does not work but that's what I need ...
ALREADY DONE:
foreach ( $produto as $key => $v) {
$array[$key][] = $v;
}
foreach ( $valor as $key => $v) {
$array[$key][] = $v;
}
foreach ( $qtd as $key => $v) {
$array[$key][] = $v;
}
foreach ( $total as $key => $v) {
$array[$key][] = $v;
}
foreach ( $modalidade as $key => $v) {
$array[$key][] = $v;
}
foreach( $array as $value){
echo "INSERT INTO 'table' ( 'produto', 'valor','qtd','total','modalidade') VALUES (".$value[0].",".$value[1].",".$value[2].",".$value[3].",".$value[4].")
}
It's working, the fact is that not always in value [0] is the product, and value [1] is value and so on ....