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) : []; } /**