diff --git a/Core/Model.php b/Core/Model.php index 3b6f15b..6140362 100644 --- a/Core/Model.php +++ b/Core/Model.php @@ -144,6 +144,19 @@ abstract class Model try { $db = static::connectDB(); + $result = $this->showAll(); + + foreach ($result as $post) { + foreach ($post as $key => $val) { + if (isset($args[$key])) { + if ($args[$key] == $post[$key]) { + return false; + } + } + } + } + + $sql = "UPDATE {$table} SET {$fields} WHERE id = ?"; $query = $db->prepare($sql);