I'm trying to display data taken directly from my database with this script :
<script>
setInterval( function contaUser(){
document.write,("<?php
$sql = "SELECT Count(id) as c FROM tb_usuario";
$result = $con->query($sql);
$row = $result->fetch_assoc();
echo $row['c'].' Usuários';
?>");
},2000 );
</script>
I already included in the file all connection data and etc ... I would like to display this data in a div, "card" style ... Could you tell me what is wrong?