title: How to reset a timer every minute if there is no query to the database?
body: <p>I have a basic server in PHP and from the mobile device I send data and save the server every 1 minute.</p>
  
  <p>But when ever my mobile phone loses the connection, I would like to set a counter on the server and if the mobile does not insert anything the database longer than 2 min. I would like to call a function in the server saying that your mobile lost connection. Every time the mobile phone sends the data to the server, timer will be reset.</p>
  
  <p>I am not familiar to PHP but I searched and couldn't find any similar things. I am sure there must be an easy way of doing it. setting a listener or creating a count down timer. </p>