I am using a JavaScript function that runs every 4 seconds with setInterval. Once this function is executed for the first time, it calls an ajax request and changes a column value in the database. I want to know how I can check if this value has been successfully updated in the database, and if it has changed, how can I stop the setInterval function from running again.
Thank you.