summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-07-19 21:28:26 +0200
committermsquare <msquare@notrademark.de>2017-07-19 21:28:26 +0200
commite93dd774a5c8338b6c29b8b39b6d883925b9ac61 (patch)
treea140391588be776714231fd4af673af61f07080f
parent0d772ec9082ef780ec67c239eba61e979143ad05 (diff)
fix small issues on checking success of a db query
-rw-r--r--includes/model/EventConfig_model.php2
-rw-r--r--src/Database/Db.php16
2 files changed, 9 insertions, 9 deletions
diff --git a/includes/model/EventConfig_model.php b/includes/model/EventConfig_model.php
index f5846870..112ad457 100644
--- a/includes/model/EventConfig_model.php
+++ b/includes/model/EventConfig_model.php
@@ -64,7 +64,7 @@ function EventConfig_update(
);
}
- return (bool)DB::update('
+ return DB::update('
UPDATE `EventConfig` SET
`event_name` = ?,
`buildup_start_date` = ?,
diff --git a/src/Database/Db.php b/src/Database/Db.php
index c1efa058..4116ffda 100644
--- a/src/Database/Db.php
+++ b/src/Database/Db.php
@@ -81,31 +81,31 @@ class Db
}
/**
- * Run a insert query
+ * Run an insert query
*
* @param string $query
* @param array $bindings
- * @return bool
+ * @return int|bool
*/
public static function insert($query, array $bindings = [])
{
self::query($query, $bindings);
- return self::$lastStatus;
+ return (self::$lastStatus ? self::$stm->rowCount() : false);
}
/**
- * Run a update query
+ * Run an update query
*
* @param string $query
* @param array $bindings
- * @return int|null
+ * @return int|bool
*/
public static function update($query, array $bindings = [])
{
self::query($query, $bindings);
- return (self::$lastStatus ? self::$stm->rowCount() : null);
+ return (self::$lastStatus ? self::$stm->rowCount() : false);
}
/**
@@ -113,13 +113,13 @@ class Db
*
* @param string $query
* @param array $bindings
- * @return int|null
+ * @return int|bool
*/
public static function delete($query, array $bindings = [])
{
self::query($query, $bindings);
- return (self::$lastStatus ? self::$stm->rowCount() : null);
+ return (self::$lastStatus ? self::$stm->rowCount() : false);
}
/**