This question has already been answered:

Good evening everyone. I’ve come across a problem that generally comes from my inexperience ... There is an Android application that has a Mysql database (remote connection via php script). In this database, there is a Status table in which it is set to false default. is there a connection at the moment or not. Checking is done this way if the request status is 200 then I update the value and make it true. But if there is no Internet, how can I send false )))) ??? I really need help how to deal with it Is there a way? Thanks for the help.

Reported as a duplicate by participants of Vadim Ovchinnikov , Denis , aleksandr barakin , user194374, post_zeew Jan 31 '17 at 18:29 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • 6
    how to send false on the internet if there is no internet? - Igor
  • I am talking about my stupidity) and I would like to know the right decision - elik
  • no, no, what stupidity? I just like the paradox. - Igor
  • one
    Well, the solution? For a client application, catch a php access error. For the server, see the time of the last call from this client, which is also stored in the database. - Igor
  • one
    You have chosen the wrong tools to solve your problem. - temq

1 answer 1

In your case, you should constantly note its date and time during the execution of an update (action, operation). In this case, active connections will have a date and time close to the current one, and those offline will have a date and time in the past.

  • Hello comrade, yes, I do, with + -2 minutes for me, not a loss. Thanks for your response - elik