What I want is to enter each element of an array in a field of my database this is my structure example table record has four fields value1, value2 value3, value4 I want to enter the following records that are generated from the following code
arraynew = array("5878-1","8978-12","2523-1");
$dato1 = "00320555555";
$dato2 = "22/02/2018";
$dato3 = "Maria Mercedes del Barrio";
$dato4 = $arraynew;
$data = array($dato1,$dato2,$dato3,$dato4);
$nuevo = array();
for($i= 0; $i < count($dato4); $i++ ){
array_push($nuevo, array(
$data[0],
$data[1],
$data[2],
$data[3][$i]
));
}
echo print_r($nuevo);
echo var_dump($nuevo);
this is the structure of the array
Array ( [0] => Array ( [0] => 00320555555 [1] => 22/02/2018 [2] => Maria Mercedes del Barrio [3] => 5878-1 ) [1] => Array ( [0] => 00320555555 [1] => 22/02/2018 [2] => Maria Mercedes del Barrio [3] => 8978-12 ) [2] => Array ( [0] => 00320555555 [1] => 22/02/2018 [2] => Maria Mercedes del Barrio [3] => 2523-1 ) ) 1
array (size=3)
0 =>
array (size=4)
0 => string '00320555555' (length=11)
1 => string '22/02/2018' (length=10)
2 => string 'Maria Mercedes del Barrio' (length=25)
3 => string '5878-1' (length=6)
1 =>
array (size=4)
0 => string '00320555555' (length=11)
1 => string '22/02/2018' (length=10)
2 => string 'Maria Mercedes del Barrio' (length=25)
3 => string '8978-12' (length=7)
2 =>
array (size=4)
0 => string '00320555555' (length=11)
1 => string '22/02/2018' (length=10)
2 => string 'Maria Mercedes del Barrio' (length=25)
3 => string '2523-1' (length=6)
What I need is to enter each array enter it in a row with its corresponding field