From 6af3289f43ba7bfb3a17182f2ac8bf77223cf505 Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Fri, 10 Feb 2017 10:54:15 +1100 Subject: [PATCH] Remove negation of condition to make the code easier to read. --- model/connect/PDOConnector.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/model/connect/PDOConnector.php b/model/connect/PDOConnector.php index e02480966..1f7a5ab9a 100644 --- a/model/connect/PDOConnector.php +++ b/model/connect/PDOConnector.php @@ -228,12 +228,12 @@ class PDOConnector extends DBConnector { $result = $this->pdoConnection->exec($sql); // Check for errors - if (!$this->hasError($result)) { - return $this->rowCount = $result; + if($this->hasError($result)) { + $this->databaseError($this->getLastError(), $errorLevel, $sql); + return null; } - $this->databaseError($this->getLastError(), $errorLevel, $sql); - return null; + return $this->rowCount = $result; } public function query($sql, $errorLevel = E_USER_ERROR) {