0
And creating a project and I needed that when the user clicked on the button "START POINTS" the Code of PHP
is activated, every 10 seconds he gains 1 point on database
and this was repeated until the user clicked on the "STOP POINTS".
I’ve done the points part, but how do I do the "timer"?
It would be like this:
Every 10 seconds it runs:
$sql_soma = mysql_query("UPDATE users SET cpoints = cpoints+1 WHERE users.user_email = '$e_mail'");
And better do it with ajax bro.
– Vitor Leite
If the logic is to start the count and stop when you click on "STOP POINTS", , you could just record the time you started and add up the time and points when you stop. Save requests and miscellaneous processes.
– Daniel Omine