Jump to content

[SOLVED] != query help


digitalgod

Recommended Posts

hey guys,

 

ok not sure how I'll explain this but here goes I have 2 tables

 

members

+-------+-------------+---------------+

|  id      |  username    |       email        |

+-------+-------------+---------------+

| 1       |    user1        | blah@blah.com |

| 2       |    user2        | 123@123.com  |

| 3       |    user3        | abc@abc.com  |

+-------+-------------+---------------+

 

friends

+-------+-------------+---------------+

|  id      |    owner       |      member     |

+-------+-------------+---------------+

|  510    |    18489      |         3           |

+-------+-------------+---------------+

 

I want to select all the members that match an array of emails like so

 

SELECT id,username
FROM members
WHERE email
IN (
'$list'
)

 

but at the same time I don't want it to return results for entries that are in the friend table. So say that my id is 18489 and that I'm looking for blah@blah.com, 123@123.com and abc@abc.com it will only return id 1 and 2 because id 3 is in the table friends and I ("owner" 18489) am the owner.. what do I have to add in my initial query in order to achieve that

 

don't know if that makes any sense...

 

any help would be greatly appreciated!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.