From a157004f4aefaa5e2265f852f9432becedee1d66 Mon Sep 17 00:00:00 2001 From: msquare Date: Sun, 23 Jul 2017 11:46:54 +0200 Subject: handle failed db queries in Db class --- src/Database/Db.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Database') diff --git a/src/Database/Db.php b/src/Database/Db.php index 4116ffda..46edc96b 100644 --- a/src/Database/Db.php +++ b/src/Database/Db.php @@ -85,13 +85,13 @@ class Db * * @param string $query * @param array $bindings - * @return int|bool + * @return int Row count */ public static function insert($query, array $bindings = []) { self::query($query, $bindings); - return (self::$lastStatus ? self::$stm->rowCount() : false); + return self::$stm->rowCount(); } /** @@ -99,13 +99,13 @@ class Db * * @param string $query * @param array $bindings - * @return int|bool + * @return int */ public static function update($query, array $bindings = []) { self::query($query, $bindings); - return (self::$lastStatus ? self::$stm->rowCount() : false); + return self::$stm->rowCount(); } /** -- cgit v1.2.3-70-g09d2