I have a code with function to show Google map named show_map(). I have a table named tb_history in my SQL database. I want to refresh the google map window only with setInterval(show_map,2000); until new data has been added to tb_history. and later, I want to add marker to the google map based on the newest data on tb_history. the reresh process will be started after a button clicked. so, when the button clicked, I count the number of data from tb_history (lets assume I put the value in $count) and compare it with $count+1. here is my plan in code:
the refresh works fine. the problem is, it won't stop after new data added to tb_history. is there someone can help me?