nydeveloper Posted March 26, 2014 Share Posted March 26, 2014 $query = $this->db->query('SELECT * FROM coinQuote WHERE date < DATE_SUB(CURDATE(), INTERVAL 60 MINUTE)'); In the query above, my goal is to select the rows from a table named coinQuote where the value in the date column (type = timestamp) is older than 60 minutes from the current time. This works perfectly until every night around 2:00 AM my time (EST), which I believe is midnight on my server's time, almost every row in the table is selected. This only happens once a day (the code with the above query runs every few minutes via a cron job) - the same time every day. It's obvious to me that the date change is what's causing the issue. Unfortunately I'm having a really tough time fixing it. Am I taking the wrong approach here, or is this approach acceptable with a little tweaking? Link to comment https://forums.phpfreaks.com/topic/287279-issue-with-phpci-datetime-query/ Share on other sites More sharing options...
nydeveloper Posted March 27, 2014 Author Share Posted March 27, 2014 This post is starting to fall back a few pages, and I'm wondering if perhaps I haven't posted it under the best topic. Link to comment https://forums.phpfreaks.com/topic/287279-issue-with-phpci-datetime-query/#findComment-1474047 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.