From e2aa0a273c112e01b2f5837f0bca7c7e8d8d4807 Mon Sep 17 00:00:00 2001 From: marijus Date: Mon, 9 Feb 2015 21:46:22 +0100 Subject: improve sql query --- include/attach.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'include/attach.php') diff --git a/include/attach.php b/include/attach.php index f61fea9a5..f878a886f 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1258,15 +1258,10 @@ function recursive_activity_recipients($allow_cid, $allow_gid, $deny_cid, $deny_ } function in_group($group_id) { - //TODO: make these two queries one with a join. - $x = q("SELECT id FROM groups WHERE hash = '%s'", + $r = q("SELECT xchan FROM group_member left join groups on group_member.gid = group.id WHERE hash = '%s' ", dbesc($group_id) ); - $r = q("SELECT xchan FROM group_member WHERE gid = %d", - intval($x[0]['id']) - ); - foreach($r as $ig) { $group_members[] = $ig['xchan']; } -- cgit v1.2.3