Invalid query:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Groups g, GroupMembers gm
where gm.LoginId = 1
and g.GroupId = gm.Grou' at line 2
Whole query:
select g.*
from Groups g, GroupMembers gm
where gm.LoginId = 1
and g.GroupId = gm.GroupId
and g.ArchiveDateTime is null
order by Rand()
limit 0,3