[RevCMS]Selecting groups of the online user

Status
Not open for further replies.

JeeCee

Member
Jan 15, 2012
96
7
Does somebody knows the MySQL query to only select groups where the userid is equal to the id of the user logged in?

In other words: I only want to show the groups which the user has joined. I've tried this, but it doesnt work.
PHP:
$GetMember = mysql_query("SELECT * FROM group_memberships WHERE userid ='".$_SESSION['id']."'");
while($Member = mysql_fetch_assoc($GetMember))
{
    $GetGroups = mysql_query("SELECT * FROM groups WHERE id='".$Member['groupid']."' ORDER BY id ASC");
    while($Groups = mysql_fetch_assoc($GetGroups))

Any ideas/help?
 
Status
Not open for further replies.

Users who are viewing this thread

Top