I need to keep a field in a data-base and update it with a time somehow, then later I need to check that time to see if it was over 30 minutes ago or not, and if not, how minutes left until 30?
I am going to be doing this with PHP+MySql can anyone tell me the simplest way to do this?
Thanks!!
Let’s assume you want to know how long ago the last update/insert in the table occurred.
You can set up a table with a timestamp field with an on update clause
and then query the record with the largest value in ts
edit: This also works if you want to get all records that have been inserted/modified within e.g. the last 12 hours.
edit2: there’s also an off chance you might be interested in http://dev.mysql.com/doc/refman/5.1/en/show-table-status.html: