0
I’m making an application web that displays a video stream, but every time I use it, you need to reload the page, and I need it to happen automatically.
My idea is to dynamically execute a query in the bank using the php, for the page update when the field value dial is equal to "0".
My attempt was the following:
<?php
$sql = "select dial from ipstream where idusuario = '7';";
while(true)
{
$retorno = mysqli_query($conexao, $sql);
$linha = mysqli_fetch_assoc($retorno);
if($linha['dial'] == "1")
{
$sql = "update ipstream set dial = '0' where idusuario = '7';";
mysqli_query($conexao, $sql);
echo "<script>location.reload();</script>";
}
}
?>
I can do this using the right AJAX?
– João Pedro
perfectly!!!
– Wallas F. Morais