From b5f347b07a76a81ec3f18c17933b8b66c1831207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Wed, 10 Nov 2021 11:21:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Command.php | 1 - src/Mysql/PDO.php | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Command.php b/src/Command.php index 21bdcd0..e581903 100644 --- a/src/Command.php +++ b/src/Command.php @@ -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; } diff --git a/src/Mysql/PDO.php b/src/Mysql/PDO.php index f80e59b..b924a2b 100644 --- a/src/Mysql/PDO.php +++ b/src/Mysql/PDO.php @@ -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();