Fix bad sql request
This commit is contained in:
+2
-3
@@ -57,11 +57,10 @@ class Movie {
|
|||||||
|
|
||||||
// 3. Commune
|
// 3. Commune
|
||||||
$stmt = $this->db->prepare("
|
$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
|
FROM movies
|
||||||
WHERE is_common = 1
|
WHERE is_common = 1
|
||||||
GROUP BY tmdb_id
|
GROUP BY tmdb_id, title, poster_path, media_type, is_common
|
||||||
ORDER BY added_at DESC
|
|
||||||
");
|
");
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$common = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$common = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|||||||
Reference in New Issue
Block a user