à ça de me faire interner
This commit is contained in:
@@ -42,6 +42,13 @@ class Movie {
|
|||||||
|
|
||||||
// C'est celle-ci qui manquait !
|
// C'est celle-ci qui manquait !
|
||||||
public function getLists($myId, $partnerId) {
|
public function getLists($myId, $partnerId) {
|
||||||
|
// --- LA CORRECTION MAGIQUE ---
|
||||||
|
// On va vérifier direct en BDD qui est ton vrai partenaire actuel à la seconde près.
|
||||||
|
$stmt = $this->db->prepare("SELECT partner_id FROM users WHERE id = ?");
|
||||||
|
$stmt->execute([$myId]);
|
||||||
|
// Si fetchColumn ne trouve rien, on force à null
|
||||||
|
$partnerId = $stmt->fetchColumn() ?: null;
|
||||||
|
|
||||||
// 1. Perso
|
// 1. Perso
|
||||||
$stmt = $this->db->prepare("SELECT * FROM movies WHERE user_id = ? AND is_common = 0 ORDER BY added_at DESC");
|
$stmt = $this->db->prepare("SELECT * FROM movies WHERE user_id = ? AND is_common = 0 ORDER BY added_at DESC");
|
||||||
$stmt->execute([$myId]);
|
$stmt->execute([$myId]);
|
||||||
|
|||||||
Reference in New Issue
Block a user