Now what I want to do is to get the fk_data_id from the table where fk_user_id 1 AND 2 matches (That would in this case be 1 and 4). I want to get them out in an array but not sure how to do so?
SELECT fk_data_id
FROM db_table
WHERE fk_user_id IN ( [COLOR="#FF0000"]1,2[/COLOR] ) -- list of users
GROUP
BY fk_data_id
HAVING COUNT(*) >= [COLOR="#FF0000"]2[/COLOR] -- number of users
note i used >=2 since you are using an auto_increment column in that table, and i’ll bet you haven’t ensured the uniqueness of the user/data combos
if you don’t understand what i just said, please at least confirm that the query works