The best way to do it is to have CreatedAt
and ModifiedAt
fields in every table in database. Then you just add ORDER BY CreatedAd LIMIT 1
. Not sure if your Time
is what I mean.
What you also have is ID. Now, if ID
is AutoIncremental
then job should be easy. Use ORDER BY id DESC LIMIT 1