From da310a91fed9bf211acd54eca789fe1bfbf8780f Mon Sep 17 00:00:00 2001 From: JNapolitanoIT Date: Thu, 23 Mar 2023 12:22:34 -0700 Subject: [PATCH] Update Builder --- src/Builder.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Builder.php b/src/Builder.php index b847d8d..4b4976d 100644 --- a/src/Builder.php +++ b/src/Builder.php @@ -156,7 +156,7 @@ public function __call(string $module = null, mixed $arguments = null): Builder public function execute(array $params = null): \PDOStatement { // prepare the statement - $statement = $this->prepare(trim($this->query)); + $statement = $this->prepare($this->query); // execute the prepared statement $statement->execute($params); @@ -185,8 +185,7 @@ private function prepare(string $query): \PDOStatement|false */ public function get(): ?array { - $results = $this->execute()->fetchAll(\PDO::FETCH_ASSOC); - return $this->query !== '' ? $results : []; + return $this->query !== '' ? $this->execute()->fetchAll(\PDO::FETCH_ASSOC) : []; } /**