diff --git a/db/DbModel.php b/db/DbModel.php index cca989b..c9b4a0d 100644 --- a/db/DbModel.php +++ b/db/DbModel.php @@ -48,7 +48,7 @@ public static function findOne($where) { $tableName = static::tableName(); $attributes = array_keys($where); - $sql = implode("AND", array_map(fn($attr) => "$attr = :$attr", $attributes)); + $sql = implode(" AND ", array_map(fn($attr) => "$attr = :$attr", $attributes)); $statement = self::prepare("SELECT * FROM $tableName WHERE $sql"); foreach ($where as $key => $item) { $statement->bindValue(":$key", $item);