From 1b37a63c345c639b6390745811946c79f672fe71 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Sun, 31 Dec 2023 17:30:50 +0100 Subject: [PATCH] fix: filter column value null in where method --- src/MySQL.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/MySQL.php b/src/MySQL.php index b88f6c3..2776854 100644 --- a/src/MySQL.php +++ b/src/MySQL.php @@ -91,6 +91,12 @@ continue; } + // Value is null so it does not need to be added to the prepared statement + if (is_null($value)) { + $filter[] = "`{$col}` IS NULL"; + continue; + } + // Create SQL for prepared statement $filter[] = "`{$col}` = ?"; // Append value to array with all other values