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        | [email protected] |

| 2       |    user2        | [email protected]  |

| 3       |    user3        | [email protected]  |

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

 

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 [email protected], [email protected] and [email protected] 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
https://forums.phpfreaks.com/topic/109070-solved-query-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.