Hi All,

I'm having problems creating a query to return a recordset from the
following situation:

I have two tables, one which contains member details, and the other
which contains details re: the groups to which the member belongs.

When a member logs into a particular part of my site, I want to show
them the details of the other people who belong to the same groups they
do.

Let's say my Members table looks like this:

memberid, membername, memberemail

1, john doe, [EMAIL PROTECTED]
2, jane doe, [EMAIL PROTECTED]
3, joe bloggs, [EMAIL PROTECTED]
4, inigo montoya, [EMAIL PROTECTED]

And my Groups table looks like this:

groupname, memberid

group1, 1
group1, 2
group2, 1
group2, 4
group3, 3

So, if I passed the query the memberid value of '1', I'd like to return
a a unique records recordset of:

1, john doe, [EMAIL PROTECTED]
2, jane doe, [EMAIL PROTECTED]
4, inigo montoya, [EMAIL PROTECTED]

Can anyone help me work out how to achieve this?

Many thanks in advance!

Regards and best wishes,

Murray Wells



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to