我想知道是否有人可以帮助我发现错误。我对加入表格很陌生,但我在最后一点做得很好。
您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 9 行的 ''(10,8)' AND d.streamitem_target IN '(10,8)') ORDER BY d.streamitem_id DE' 附近使用正确的语法
$call="SELECT d.*, c.*, u.*
FROM streamdata AS d
JOIN streamdata_comments AS c ON d.streamitem_id = c.comment_streamitem
JOIN users AS u ON u.id = c.comment_poster
WHERE c.comment_poster = '$following_string'
AND d.streamitem_id < '$lastID'
AND (d.streamitem_target = '$following_string' OR
d.streamitem_creator = '$following_string')
OR d.streamitem_creator IN '$friendlist'
AND d.streamitem_target IN '$friendlist'
ORDER BY d.streamitem_id DESC LIMIT 10";