From dd9e1117411e02be33a96c654e252f8ae8c961dd Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Thu, 4 Apr 2019 03:12:09 -0400 Subject: [PATCH] Saves null value to DB as `null` (#6) --- src/Database/SqlDatabase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Database/SqlDatabase.php b/src/Database/SqlDatabase.php index 354d794..3ef4d5d 100644 --- a/src/Database/SqlDatabase.php +++ b/src/Database/SqlDatabase.php @@ -71,7 +71,7 @@ public function getRows($table, $columns, $where) public function updateByPrimary($table, $primaryKeyValue, $column, $value) { $where = $this->buildWhereForArray($primaryKeyValue); - $quotedValue = $value === null ? $value : $this->pdo->quote($value); + $quotedValue = $value === null ? 'null' : $this->pdo->quote($value); $sql = "UPDATE {$table}