Answer the question
In order to leave comments, you need to log in
How to simplify or speed up the request?
Hello! Tell me, is there a more beautiful way to determine whether the user is a member of the community?
When selecting community lists, you need to constantly know if the current user is a member of each community ... As a result, the query turns out like this ...
SELECT g.`id`, g.`title`, g.`descr`, gm.`id` is_member
FROM `groups` g
LEFT JOIN `groups_members` gm ON gm.`group_id` = gm.`id` AND gm.`user_id` = ".$this->user->getUserId()."
LIMIT 0, 20
Answer the question
In order to leave comments, you need to log in
Here you will have a bot, with 30-40K intros, exits. And everything will hang on one user.
Why do you need to make a selection with the name and description of the group in advance? I would make two requests.
1) would choose groups where the user participates.
2) Uploaded the description of the groups.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question