From d8b2d1ca2c671d6a8d0e02042b34cc17b0eca467 Mon Sep 17 00:00:00 2001 From: whwyy Date: Wed, 10 Jan 2024 17:59:05 +0800 Subject: [PATCH] eee --- Command.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Command.php b/Command.php index 3f58e49..8f2de37 100644 --- a/Command.php +++ b/Command.php @@ -117,7 +117,6 @@ class Command extends Component { $client = $this->connection->getConnection(); try { - $this->connection->println($this->sql, $this->params); if (($prepare = $client->prepare($this->sql)) === false) { throw new Exception('(' . $prepare->errorInfo()[0] . ')' . $client->errorInfo()[2]); } @@ -127,6 +126,8 @@ class Command extends Component $result = $method == 'rowCount' ? $prepare->rowCount() : $prepare->{$method}(PDO::FETCH_ASSOC); $prepare->closeCursor(); + $this->connection->println($this->sql, $this->params); + return $result; } catch (Throwable $throwable) { if ($this->isRefresh($throwable)) return $this->search($method); @@ -169,6 +170,8 @@ class Command extends Component $result = $client->lastInsertId(); + $this->connection->println($this->sql, $this->params); + return $result == 0 ? $prepare->rowCount() : (int)$result; } catch (Throwable $throwable) { if ($this->isRefresh($throwable)) return $this->_prepare();