MySQL Forums
Forum List  »  PHP

Mutual Matches
Posted by: Josh
Date: April 21, 2006 04:22PM

This is probably a stupid question, but here goes:
I have a table for a new site I am working on that keeps track of user's favorite members. The table consists of 3 fields, a favID, userID, userFav (I assume this is an okay way of doing it.)

Now how do I run a query for user X to see who else has him on their fav list? So I'm trying to do mutual matches. If user X favs users Y and Z, and user Y favs user X, I need a query giving me user Y as a result.

Any help would be appreciated, I use PHP 5.x and MySQL 5.x.



Edited 1 time(s). Last edit at 04/21/2006 04:22PM by Josh .

Options: ReplyQuote


Subject
Written By
Posted
Mutual Matches
April 21, 2006 04:22PM
April 21, 2006 05:12PM
April 21, 2006 05:29PM
April 21, 2006 06:42PM
April 23, 2006 12:01PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.