From 8ff61b727561a471705d5130f063e8f15cc8e589 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Tue, 31 Oct 2023 15:38:33 +0100 Subject: [PATCH] fix: select() with no table model defined throws error (#12) --- src/MySQL.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/MySQL.php b/src/MySQL.php index 62bfa2f..2d172eb 100644 --- a/src/MySQL.php +++ b/src/MySQL.php @@ -12,7 +12,7 @@ // Interface for MySQL_Driver with abstractions for data manipulation class MySQL extends DatabaseDriver { private string $table; - private array $model; + private ?array $model = null; private ?string $order_by = null; private ?string $filter_sql = null; @@ -152,8 +152,6 @@ // Interpolate components into an SQL SELECT statmenet and execute $sql = "SELECT {$columns_sql} FROM {$this->table}{$filter_sql}{$order_by_sql}{$limit_sql}"; - $test = $this->model; - // No columns were specified, return true if query matched rows if (!$columns) { return $this->exec_bool($sql, $this->filter_values);