Hey guys,

So, as the title says, trying to join four tables.

The purpose of the script is to:

  1. Get the username of members being "followed" from table called following

  2. Find the status updates of members in step one from table called status

  3. Retrieve all comments on status from step two from table named status_comments

  4. Get the members avatar location from table named users

I am posting from my phone at the moment, so cannot include the existing code....
I have no problems joining three of the four tables, just adding the fourth is killing me...

Some schema is below:

Members being "followed": following.member
Being "followed" by: following.followed_by
Status ID: status.id
Comments: status_comments.sid
Status "owner": status.member
Members who posted a comment: status_comments.comment_by
Commenters avatar: users.pic

Even just showing me the way to structure this query with psuedo code would be a great help!

Thank you in advance!

Member Avatar

Perhaps if you could post your table schemas and indicate with an asterisk which fields you need included and include any relevant filters (e.g. WHERE or HAVING clauses).