PHP MySQL query string
Posted
by
user1174762
on Stack Overflow
See other posts from Stack Overflow
or by user1174762
Published on 2012-06-03T04:35:43Z
Indexed on
2012/06/03
4:40 UTC
Read the original article
Hit count: 85
I am newer 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 ones from users I am "following", and then display them In order by date. So, I have two databases which are set up like so:
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!
© Stack Overflow or respective owner