From c830bfcd9630aa4ec9eca0b3ceca48a0d12d9b1c Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 14 Dec 2016 20:50:39 +0100 Subject: [PATCH] fixed SQL writing: keywords upper-case, column/table names in back-ticks. #3010 Signed-off-by: Roland Haeder --- include/queue_fn.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/queue_fn.php b/include/queue_fn.php index f262072e6f..81bcf0f2b3 100644 --- a/include/queue_fn.php +++ b/include/queue_fn.php @@ -24,14 +24,14 @@ function remove_queue_item($id) { */ function was_recently_delayed($cid) { - $r = q("SELECT `id` FROM `queue` WHERE `cid` = %d - and last > UTC_TIMESTAMP() - interval 15 minute limit 1", + $r = q("SELECT `id` FROM `queue` WHERE `cid` = %d + AND `last` > UTC_TIMESTAMP() - INTVAL 15 MINUTE LIMIT 1", intval($cid) ); if (dbm::is_result($r)) return true; - $r = q("select `term-date` from contact where id = %d and `term-date` != '' and `term-date` != '0000-00-00 00:00:00' limit 1", + $r = q("SELECT `term-date` FROM `contact` WHERE `id` = %d AND `term-date` != '' AND `term-date` != '0000-00-00 00:00:00' LIMIT 1", intval($cid) );