From 12cee6e25a3113fc3582201fba4b95d0f37ebaf1 Mon Sep 17 00:00:00 2001 From: Tiago Peralta Date: Mon, 11 Dec 2017 02:05:26 +0000 Subject: [PATCH] There was a bug here, whereas the query is perfectly fine, but instead of returning false it was returning the this->sqlError.... which by then was returning the return false, the problem was the log in the cron that was misleading, took 2 days figuring this one out --- include/classes/notification.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/classes/notification.class.php b/include/classes/notification.class.php index c1807dd9..396072c6 100644 --- a/include/classes/notification.class.php +++ b/include/classes/notification.class.php @@ -23,8 +23,16 @@ class Notification extends Mail { $data = json_encode($aData); $stmt = $this->mysqli->prepare("SELECT id FROM $this->table WHERE data = ? AND active = 1 LIMIT 1"); if ($stmt && $stmt->bind_param('s', $data) && $stmt->execute() && $stmt->store_result() && $stmt->num_rows == 1) - return true; - return $this->sqlError('E0041'); + { + return true; + } + + if( $stmt->errno ) + { + return $this->sqlError(); + } + + return false; } /**