gpt4 book ai didi

php - 两个表,一个用于帖子,另一个用于相互连接的 friend 如何检索 friend 的帖子

转载 作者:行者123 更新时间:2023-11-29 03:31:37 26 4
gpt4 key购买 nike

我有两个表,第一个是 post,其中有 post_bypost columns,第二个是 connectionstbl,其中有 memberid 和connected with,其中member 是登录用户,connectedWith 是好友

如何在 post_by=the connectedwith

中检索帖子列的数据

查询如下:

$result=mysql_query("
select
social_posts.posted_by,
social_posts.post as social_posts_post connectionstbl.connectedwith
from
social_posts,connectionstbl
where
social_posts.posted_by = connectionstbl.connectedwith
order by social_posts.p_id desc
");
while ($row =mysql_fetch_array($result))
{

echo $row['social_posts_post']."<br/>";
}
?>

执行查询不输出任何内容。

最佳答案

您在 social_posts_post 和 connectionstbl.connectedwith 之间缺少一个逗号。我猜你的 error_reporting 或 display_errors 配置参数设置为不显示错误,否则你会看到警告。

关于php - 两个表,一个用于帖子,另一个用于相互连接的 friend 如何检索 friend 的帖子,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29889132/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com