hi all i whant to call a function that return the number of notification in my database so i made this function
it working but i need to refrech the page i don’t know why it didn’t chage automaticly
$(document).ready(
function() {
setInterval(function() {
// var randomnumber = Math.floor(Math.random() * 100);
<?php
$var = Yii::app()->db->createCommand('select * from notification where etat = "non lu" and id_user ='.Yii::app()->user->id)->query();
$count = count ( $var);
?>
var span = document.getElementById("show");
span.textContent = <?php echo $count; ?> ;
}, 1000);
}) ;
can someone help me please thx