I need a function to recharge one every X seconds because the value of the BBDD can change. I have the following, but I do not update the value. What fails me?
div:
<div id="results">valor a cargar</div>
The script:
function sendRequest(){
$.ajax({
url: "ajax/count.php",
success:
function(result){
$('#results').text(result);
setTimeout(function(){
sendRequest();
}, 3000);
}});
});
and the code in "ajax / count.php" returns the total values of a table:
while($row = mysql_fetch_assoc($result))
{
echo $row['TOTAL'];
}