What I'm trying to do is limit the rows that display with two columns. So,
SELECT `whatever` FROM `table` WHERE `id` = '2' AND `userid` = '3'
However, what I want to do is have more userids in the query, however if I did that I would have to keep adding 'id' = 2....
e.g. SELECT `whatever` FROM `table` WHERE `id` = '2' AND `userid` = '3' OR `id` = '2' AND `userid` = '5' OR `id` = '2' AND `userid` = '8'
Is there any different way of doing this as it would be different for each member of my site and some people would have many friends - which would presumably slow down the query.
What I want is it to grab that row from the database (which is the id), but needs to check that it has been sent from only his/her friends (which is the userid) - so whether i need to do it by php aswell
I seem to be having a mental block of what to do, so I'd be grateful if somebody could give me a little help please! =)
Thanks!
Edited by webradar, 24 February 2008 - 06:54 PM.
