Error inserting an array in mysql


I had to create this route of an array since I need to insert more than 1 million records in mysql and make an insert per record throws me error, I find that the ideal is to make a massive insert but at the moment of executing it throws me this error . (Notice: Array to string conversion in). What am I doing wrong?

foreach ($datosarray as $a=>$b){
    $query = "INSERT INTO mesanterior VALUES";

    foreach($b as $c => $d){
        $query.= " ($d),";
    $query = substr($query,0,-1);
asked by Diego Sanchez 10.12.2018 в 23:22

0 answers