Ahhh...see...you *DID* need to clarify the issue about "following"!

SO...Keep it simple:

Code:

SELECT P.author, P.post, P.date, F.friends, F.following, F.f1, F.f2, F.status
FROM posts AS P, friends AS F
WHERE ( F.f1 = '$me' AND F.f2 = P.author AND F.status = 1 )
OR ( F.f2 = '$me' AND F.f1 = P.author AND F.status = 1 )
OR ( F.f1 = '$me' AND F.f2 = P.author AND F.following = True )
ORDER BY `date` DESC

But you can simplify that a little:

Code:

SELECT P.author, P.post, P.date, F.friends, F.following, F.f1, F.f2, F.status
FROM posts AS P, friends AS F
WHERE ( F.f1 = '$me' AND F.f2 = P.author AND ( F.status = 1 OR F.following = True ) )
OR ( F.f2 = '$me' AND F.f1 = P.author AND F.status = 1 )
ORDER BY `date` DESC

You *need* the parentheses around ` ( F.status = 1 PR F.following = True )`

, but the others aren't truly needed. I would certainly leave them in, though, for clarity.

$me can of course be any one person you are trying to match. Example: `$me = 'Elitis';`