diff --git a/src/App/AccountPages.php b/src/App/AccountPages.php index 7a34e9c..89baf44 100755 --- a/src/App/AccountPages.php +++ b/src/App/AccountPages.php @@ -727,10 +727,13 @@ final class AccountPages INNER JOIN events e ON e.id = ep.event_id INNER JOIN users u ON u.id = e.created_by LEFT JOIN user_profiles up ON up.user_id = u.id - WHERE ep.user_id = :id AND e.created_by <> :id AND e.starts_at >= NOW() + WHERE ep.user_id = :participantId AND e.created_by <> :ownerId AND e.starts_at >= NOW() ORDER BY e.starts_at ASC' ); - $stmt?->execute(['id' => $userId]); + $stmt?->execute([ + 'participantId' => $userId, + 'ownerId' => $userId, + ]); $eventsJoinedUpcoming = $stmt?->fetchAll(\PDO::FETCH_ASSOC) ?: []; $stmt = $pdo?->prepare( @@ -741,10 +744,13 @@ final class AccountPages INNER JOIN events e ON e.id = ep.event_id INNER JOIN users u ON u.id = e.created_by LEFT JOIN user_profiles up ON up.user_id = u.id - WHERE ep.user_id = :id AND e.created_by <> :id AND e.starts_at < NOW() + WHERE ep.user_id = :participantId AND e.created_by <> :ownerId AND e.starts_at < NOW() ORDER BY e.starts_at DESC' ); - $stmt?->execute(['id' => $userId]); + $stmt?->execute([ + 'participantId' => $userId, + 'ownerId' => $userId, + ]); $eventsJoinedPast = $stmt?->fetchAll(\PDO::FETCH_ASSOC) ?: []; if (isset($_GET['edit_event'])) {