I use the connect function of friends using SQL. I used the following code:
SELECT relationship.requester, relationship.requested, user.firstname, user.lastname FROM relationship JOIN user ON (user.guid = relationship.requester OR user.guid = sqrelationship.requested) WHERE relationship.requester = {$userid} OR relationship.requested = {$userid} AND relationship.approved = 1
SQL will return a table with the identifiers of the approved relationships initiated or received by the user. However, user.firstname and user.lastname return me only one set of results. How can I make this expression get both the requestor and the requested names?
source share