I need to put a loading message while a sql statement is executed, since the specific statement will take a while to complete and I would like a gif or a simple message to be displayed. I attached my PHP code
try{
include ('./pdo.php');
$consulta = $con->prepare("insert into datos values(:codigo,:anio,:mes,:precip,:temp,:tempMax,:tempMin)");
$consulta->bindValue(':codigo',$codigo,PDO::PARAM_STR);
$consulta->bindValue(':anio',$anio,PDO::PARAM_STR);
$consulta->bindValue(':mes',$mes,PDO::PARAM_STR);
$consulta->bindValue(':precip',$precip,PDO::PARAM_STR);
$consulta->bindValue(':temp',$temp,PDO::PARAM_STR);
$consulta->bindValue(':tempMax',$tempMax,PDO::PARAM_STR);
$consulta->bindValue(':tempMin',$tempMin,PDO::PARAM_STR);
$resultado = $consulta->execute();
}catch(PDOException $e){
echo 'Error:'.$e->getMessage()."\n";
echo "<br>";
echo 'Error getFile:'.$e->getFile()."\n";
}
This code is inside a loop and if there are many records that you have to insert it takes a while. Thank you in advance to everyone!