From 44d350cfeab6d9fa8b668c1ae4fd15a2e30a74a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 7 Apr 2023 21:37:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Command.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Command.php b/Command.php index df938cf..e0e8bdc 100644 --- a/Command.php +++ b/Command.php @@ -96,9 +96,7 @@ class Command extends Component if (($prepare = $client->prepare($this->sql)) === false) { throw new Exception($client->errorInfo()[1]); } - foreach ($this->params as $key => $param) { - $prepare->bindParam($key, $param); - } + $prepare->execute($this->params); return $prepare->fetch(PDO::FETCH_ASSOC); } catch (\Throwable $throwable) { if (str_contains($throwable->getMessage(), 'MySQL server has gone away')) {