From 491ec4cf4e2e75779247b4bd248cab1a8580a38c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 28 Apr 2021 10:55:09 +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 --- Database/Command.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Database/Command.php b/Database/Command.php index 7983fa43..d3930b37 100644 --- a/Database/Command.php +++ b/Database/Command.php @@ -11,11 +11,9 @@ namespace Database; use Exception; -use JetBrains\PhpStorm\Pure; use PDO; use PDOStatement; use Snowflake\Abstracts\Component; -use Snowflake\Core\Json; use Swoole\Coroutine; /** @@ -123,8 +121,8 @@ class Command extends Component private function execute($type, $isInsert = null, $hasAutoIncrement = null): int|bool|array|string|null { try { - $time = microtime(true); - if ($type === static::EXECUTE) { + $time = microtime(true); + if ($type === static::EXECUTE) { $result = $this->insert_or_change($isInsert, $hasAutoIncrement); } else { $result = $this->search($type); @@ -209,7 +207,8 @@ class Command extends Component return $this->addError($this->sql . ':' . $error, 'mysql'); } $result = $prepare->execute($this->params); - $prepare->closeCursor(); + var_dump($result, $connect->errorInfo()); + defer(fn() => $prepare->closeCursor()); if ($result === false) { return $this->addError($connect->errorInfo()[2], 'mysql'); }