Path: C:\
<?php
ini_set('max_execution_time',259200);
ini_set ('memory_limit','-1');
require_once("../conexao_mysql_locaweb.php");
$data = [];$cont=0;
$json = file_get_contents('json/Sitrad.json');
$data = json_decode($json, true);
foreach ($data as $row => $cells) {
$stmt = "INSERT INTO sitrad (id_arm, dia_hora, temperatura, umidade)
VALUES (
" . $cells["id_arm"] . ",
" . $cells["dia_hora"] . ",
" . $cells["temperatura"] . ",
" . $cells["umidade"] . ")";
if(mysqli_query($conn3, $stmt))
{ $cont++; }
else
{ echo "ERRO na Inclusão: ".($cont+1)."<br>";}
}
echo "<br>Incluidos ".$cont." registros!<br>";