I am new to PHP and MySQL and I am having trouble understanding JOIN. I think, for me, the problem lies with actually understanding the logic of the query. What I am trying to do is select all of the status updates from a table named “post”, but only the ones from users I am “following”, and then display them in order by date. So, I have two databases which are set up like this:
posts
|post_id|user_id|post_body|date_upload|
| 1 | 4 | hey. | 01/2/2012 |
follows
|relation_id|user_id|followee_id|
| 1 | 4 | 2 |
Could someone please explain how I should syntactically and logically set this up?
Thank you!
I think you’ll find this will work: