I am trying to come up with a query, or series of queries to determin whether or not a user is a member of a given group. In my problem users can be members of meny groups, and groups can inturn be members of another group, much like windows nt.
I can easily identify members of a group using a WHERE userid = groupid match. And likewise I can use WHERE groupid = groupid to find groups of groups. But the nested groups can go on an on.
Using php i am thinking of finding the groups that a user is a direct member of, then doing a looped query that will find the indirect groups until no more groups exist. All the time entering the member ship data into a temp table.
I realise there are issues with circular refs here, and nesting limits, but not sure how to proceed.
Thanks
Paul
I can easily identify members of a group using a WHERE userid = groupid match. And likewise I can use WHERE groupid = groupid to find groups of groups. But the nested groups can go on an on.
Using php i am thinking of finding the groups that a user is a direct member of, then doing a looped query that will find the indirect groups until no more groups exist. All the time entering the member ship data into a temp table.
I realise there are issues with circular refs here, and nesting limits, but not sure how to proceed.
Thanks
Paul