diff --git a/services/DatabaseService.php b/services/DatabaseService.php index 414bb3c6..6e116568 100644 --- a/services/DatabaseService.php +++ b/services/DatabaseService.php @@ -36,20 +36,25 @@ class DatabaseService } } - if ($params == null) + if ($params === null) { - if ($pdo->exec($sql) === false) { - throw new \Exception($pdo->errorInfo()); + throw new \Exception(implode(' | ', $pdo->errorInfo())); } } else { $cmd = $pdo->prepare($sql); + + if ($cmd === false) + { + throw new \Exception(implode(' | ', $pdo->errorInfo())); + } + if ($cmd->execute($params) === false) { - throw new \Exception($pdo->errorInfo()); + throw new \Exception(implode(' | ', $cmd->errorInfo())); } }