2
.....
$sqlContar = mysqli_query($conexao,"SELECT COUNT(*) AS ContarTeste FROM teste");
$jmContar = mysqli_fetch_object($sqlContar);
?>
<html>
<head>
<title>Nome do Site</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<script type="text/javascript">
window.setInterval(function() {
mudarTitulo();
}, 1000);
function mudarTitulo() {
document.title = "("+<?php echo $jmContar->ContarTeste; ?>+") Nome do Site";
}
// setTimeout(mudarTitulo(), 1000);
</script>
</head>
<body>
</body>
</html>
But it only works if I press the F5.
PHP runs only once, so it is not possible to do a new count using php this way... what you can do is send a request in ajax to fetch the values in php.
– Silvio Andorinha