how to clear a field in database in x mins? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: how to clear a field in database in x mins? (/showthread.php?tid=71159) Pages:
1
2
|
RE: how to clear a field in database in x mins? - skunkbad - 07-14-2018 (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/ RE: how to clear a field in database in x mins? - richb201 - 07-15-2018 Thanks Brian. I am not sure why but the Interval 1 Hour worked. RE: how to clear a field in database in x mins? - skunkbad - 07-15-2018 (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. |