我对这段代码有疑问:
$comments->query = "SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, " . PREFIX . "_comments.date, " . PREFIX . "_comments.autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . USERPREFIX . "_users.email, news_num, " . USERPREFIX . "_users.comm_num, user_group, lastdate, reg_date, signature, foto, fullname, land, yahoo, " . USERPREFIX . "_users.xfields, " . PREFIX . "_post.title, " . PREFIX . "_post.date as newsdate, " . PREFIX . "_post.alt_name, " . PREFIX . "_post.category FROM " . PREFIX . "_comments LEFT JOIN " . PREFIX . "_post ON " . PREFIX . "_comments.post_id=" . PREFIX . "_post.id LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_comments.user_id=" . USERPREFIX . "_users.user_id " . $where . " ORDER BY id desc";
错误:
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 'ON dle_comments.post_id=dle_post.id LEFT JOIN dle_users ON dle_comments.user_id=' at line 1
编辑:
SELECT
dle_comments.id, post_id,
dle_comments.user_id,
dle_comments.date,
dle_comments.autor as gast_name,
dle_comments.email as gast_email,
text, ip, is_register,
group_concat(mid) as `awards`,
name, dle_users.email, news_num,
dle_users.comm_num, user_group,
lastdate, reg_date, signature,
foto, fullname, land, icq,
dle_users.xfields, dle_post.title,
dle_post.date as newsdate, dle_post.alt_name, dle_post.category
FROM
dle_comments
LEFT JOIN dle_awards
ON uid = dle_post
ON dle_comments.post_id=dle_post.id
LEFT JOIN dle_users
ON dle_comments.user_id=dle_users.user_id
ORDER BY id desc
LIMIT 0,30
我的 SQL 版本:5.5.20
我该如何解决这个问题?