From 2fd37f90a33dd4b65a88b0e5a3dec946edbb5a2a Mon Sep 17 00:00:00 2001 From: whwyy Date: Fri, 26 Apr 2024 15:28:40 +0800 Subject: [PATCH] eee --- Command.php | 2 ++ SqlBuilder.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Command.php b/Command.php index e66a4de..f6b6fd2 100644 --- a/Command.php +++ b/Command.php @@ -99,6 +99,8 @@ class Command extends Component $prepare->execute($this->params); + $prepare->fetch(); + $count = $prepare->rowCount(); $prepare->closeCursor(); diff --git a/SqlBuilder.php b/SqlBuilder.php index 57c98d6..294333f 100644 --- a/SqlBuilder.php +++ b/SqlBuilder.php @@ -235,7 +235,7 @@ class SqlBuilder extends Component */ public function count(): string { - return $this->makeSelect(['0']) . $this->make(); + return $this->makeSelect(['COUNT(*)']) . $this->make(); }