This commit is contained in:
2021-11-10 11:21:20 +08:00
parent a113d5f64b
commit b5f347b07a
2 changed files with 2 additions and 1 deletions
-1
View File
@@ -129,7 +129,6 @@ class Command extends Component
} catch (\Throwable $exception) {
$result = $this->addError($this->sql . '. error: ' . $exception->getMessage(), 'mysql');
} finally {
var_dump($result);
$this->db->release();
return $result;
}
+2
View File
@@ -251,9 +251,11 @@ class PDO implements StopHeartbeatCheck
$this->_last = time();
$pdo = $this->_pdo();
if (!(($prepare = $pdo->prepare($sql)) instanceof PDOStatement)) {
var_dump($prepare->errorInfo());
throw new Exception($prepare->errorInfo()[2] ?? static::DB_ERROR_MESSAGE);
}
if ($prepare->execute($params) === false) {
var_dump($prepare->errorInfo());
throw new Exception($prepare->errorInfo()[2] ?? static::DB_ERROR_MESSAGE);
}
$result = (int)$pdo->lastInsertId();