diff --git a/src/Validator.php b/src/Validator.php index 808bd73..3f90cb5 100644 --- a/src/Validator.php +++ b/src/Validator.php @@ -374,7 +374,7 @@ private function prepareUniquenessValidatorSql(array $field_names, mixed $where) return $this->connection->prepare( sprintf( - "SELECT COUNT(`id`) AS 'row_count' FROM %s WHERE (%s) AND (`id` != ?)", + "SELECT COUNT(`id`) AS 'row_count' FROM %s WHERE `id` != ? AND (%s)", $this->connection->escapeTableName($this->table_name), implode(' AND ', $conditions) ),