我不知道是否有人可以幫我發現錯誤。我很想加入表格,但我做得很好,最後一點。連接表(SQL語法錯誤)
您的SQL語法錯誤;檢查與您的MySQL服務器版本相對應的手冊,以在''(10,8)'AND d.streamitem_target IN'(10,8)')附近使用正確的語法。在第9行的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";
看來你引述IN(...)語法:'..在'$ friendlist'中。請過*真實*查詢,即解析的$ $ call變量。 –
如果'$ friendlist'是一個包含圓括號的字符串,請不要用引號引起來。 – Matt