I'm doing a PHP script timer and write the duration to MySQL database every second. The code is something like this:
for($i=0; $i<60; $i++){
//Update MySQL database
sleep(1);
}
However, this script won't stop after I close my browser. It keep updating my database until it finish the loop. Is there any solution for this?
Thank you!