Advertisement
NelsonGG

Untitled

Oct 11th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. $dataInsert = '';
  2. $cont = 0;
  3. $datosCount = count($Adatos);
  4. foreach ($Adatos as $id=>$datos){
  5.     if ($dataInsert == ''){
  6.         $dataInsert = "INSERT INTO presupuesto_financiero_real (mes,anio,lineadid,fecha,lineadato) VALUES ";
  7.     }
  8.     $dataInsert .= "({$datos['iMes']},{$datos['iAnio']},{$datos['did']},'{$datos['desde']}','".round($datos['valor'],2)."'),";
  9.    
  10.     if ($cont >= 4000 || $id+1 >= $datosCount){
  11.         if ($dataInsert != ''){
  12.             $dataInsert = substr($dataInsert,0,-1);
  13.         }
  14.  
  15.         if ($dataInsert != ''){
  16.             $mysqliSOL->query($dataInsert);
  17.         }
  18.         $cont = 0;
  19.         $dataInsert = '';
  20.     }
  21.     $cont++;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement