I wonder if someone can help spot the error for me. I’m pretty new to joining tables but I did well up to the last bit.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ”(10,8)’ AND d.streamitem_target IN ‘(10,8)’) ORDER BY d.streamitem_id DE’ at line 9
$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";
should be
You do not quote
INvariables.The same applies to the
AND d.streamitem_target IN '$friendlist'line.