qlithe
Supreme Member
- Feb 14, 2012
- 1,252
- 288
Hey
I need a way to constantly update my users balance and update a column in my database called "last activity". I'm considering something like this:
Are there any downsides to this method? Will it be very resource heavy?
Thanks in advance
I need a way to constantly update my users balance and update a column in my database called "last activity". I'm considering something like this:
Code:
$(document).ready(function(){
function update()
{
$.ajax({
type:"post",
url:"update.php",
data:formData,
dataType: 'text',
success:function(data){
// get balance from mysql
// update column in mysql
},
complete:function(){
setTimeout(update, 5000);
},
global: false
});
}
setTimeout(update, 5000);
});
Are there any downsides to this method? Will it be very resource heavy?
Thanks in advance