This commit is contained in:
2023-04-07 21:37:14 +08:00
parent 2170ea7d29
commit 44d350cfea
+1 -3
View File
@@ -96,9 +96,7 @@ class Command extends Component
if (($prepare = $client->prepare($this->sql)) === false) { if (($prepare = $client->prepare($this->sql)) === false) {
throw new Exception($client->errorInfo()[1]); throw new Exception($client->errorInfo()[1]);
} }
foreach ($this->params as $key => $param) { $prepare->execute($this->params);
$prepare->bindParam($key, $param);
}
return $prepare->fetch(PDO::FETCH_ASSOC); return $prepare->fetch(PDO::FETCH_ASSOC);
} catch (\Throwable $throwable) { } catch (\Throwable $throwable) {
if (str_contains($throwable->getMessage(), 'MySQL server has gone away')) { if (str_contains($throwable->getMessage(), 'MySQL server has gone away')) {