how to clear a field in database in x mins? |
(07-14-2018, 07:58 AM)richb201 Wrote: Guys, I am a little confused. Is "INTERVAL 1 HOUR" and "INTERVAL 10 DAY" some kind of constants or are they pseudo code? I think the problem I am having is based on the "TIMESTAMPDIFF(MINUTE, NOW(), 'modified')" which is part of MariaDb. I can certainly subtract instead. But how do I get the Interval 1 Hour. Or even more precisely, how do I write the SQL that will only return the record that is both for the right fp_code and is less than 1 hour old? what I currently have is "INTERVAL" is also part of MySQL / MariaDB: http://www.mysqltutorial.org/mysql-interval/
Thanks Brian. I am not sure why but the Interval 1 Hour worked.
proof that an old dog can learn new tricks
(07-15-2018, 06:31 AM)richb201 Wrote: Thanks Brian. I am not sure why but the Interval 1 Hour worked. At least for me, SQL (MySQL and MariaDB) is a lot harder to master than PHP. Its error messages are often unclear, and its documentation is harder to understand. I've been using it for 12+ years and still don't feel like I'm great with it. It definitely takes a lot of learning and experience to fully understand. |
Welcome Guest, Not a member yet? Register Sign In |