In this task I use Arduino uno + GSM sim900 and GPS Module. I have a problem making notifications when the GPS module that is placed in the vehicle is damaged or removed. How to check that? I'm thinking to check the last id on the GPS module in the database is increasing or not? Is it true? How to make the notification in PHP?
If your device is sending a heartbeat to some system (saying “I’m alive and well” every X minutes) then the system receiving this heartbeat needs to notice the messages are no longer coming in and can trigger the alert
How you code this depends on your coding language on the receiving system.
If your arduino speaks directly to the database then you need a separate process checking for timing in the database. It can be a separate app or depending on your database capabilities (SQL stored procedures and events) something you can configure directly in the database
A typical implementation is to store the log of heartbeats with their time stamp information and associated data (like GPS position etc) and have a batch process running from time to time fetch the latest record for each device you track, extract the time stamp and compare it with the current time and decide if it has been too long or not.
Whatever duration you want to have to trigger your alert for example 5 minutes or 1 hour or 10 seconds depending how often you receive the heartbeat and how many heartbeats you are OK to be missing before triggering the alert