In MySQL's latest version you can use the information_schema database if another table is already updated like this:
SELECT UPDATE_TIME
FROM information_schema.tables
WHERE TABLE_SCHEMA = 'dbname'
AND TABLE_NAME = 'tabname'
This will help you to open a connection to the database.
The other option is to "touch" a particular file whenever the MySQL table is updated, you'll find it on database updates:
Open your timestamp file in O_RDRW mode
close it again
0 or alternatively
To change the file timestamp, you can use touch() which is PHP equivalent of the utimes() function, and you will find it on On-page display:
use stat() to read back the file modification time.
Enroll yourself in the best sql courses to learn in-depth about SQL statements, queries and become proficient in SQL.