From 92e8bf9cdc5119eed4ac72086da4fcce9713359d Mon Sep 17 00:00:00 2001 From: Whykioh Date: Sat, 11 Jul 2026 20:29:14 +0200 Subject: [PATCH] Fix bad sql request --- models/Movie.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/models/Movie.php b/models/Movie.php index 6eedf26..edad9b8 100644 --- a/models/Movie.php +++ b/models/Movie.php @@ -57,11 +57,10 @@ class Movie { // 3. Commune $stmt = $this->db->prepare(" - SELECT * + SELECT MAX(id) as id, tmdb_id, title, poster_path, media_type, is_common, MAX(added_at) as added_at FROM movies WHERE is_common = 1 - GROUP BY tmdb_id - ORDER BY added_at DESC + GROUP BY tmdb_id, title, poster_path, media_type, is_common "); $stmt->execute(); $common = $stmt->fetchAll(PDO::FETCH_ASSOC);