此SQL语句显示我关注的每个人的帖子。
如何对其进行编辑,以便显示我的帖子以及我关注的人?
$query_posts = "
SELECT
post.sqlid,
post.status,
post.username_posting,
post.date_time,
post.status_id,
FROM posts
INNER JOIN followers
ON post.username_posting = followers.following
WHERE followers.follower = '$login_user'";
答案 0 :(得分:2)
尝试使用OR
post.username_posting
条件
$query_posts = "SELECT
post.sqlid,
post.status,
post.username_posting,
post.date_time,
post.status_id
FROM posts
INNER JOIN followers ON post.username_posting = followers.following
WHERE
followers.follower = '$login_user' OR post.username_posting = '$login_user'";