mysql 错误:未知列“thread.threadid”在“on 子句”中
我收到以下错误...
ERROR:
mysql error: Unknown column 'thread.threadid' in 'on clause'
我听说它与 MySQL 版本有关...我需要对 PHP 代码进行哪些更改才能通过此错误?我读到,出现此错误是因为在 SELECT 查询中使用了逗号运算符。此查询并非设计用于在新的 MySQL 5 严格查询解析器下工作,该解析器将逗号视为低于连接的优先级。
Database error in vBulletin 3.0.7:
Invalid SQL:
SELECT thread.threadid, thread.forumid
FROM thread AS thread, subscribethread AS subscribethread
LEFT JOIN deletionlog AS deletionlog ON(deletionlog.primaryid = thread.threadid AND type = 'thread')
WHERE subscribethread.threadid = thread.threadid
AND subscribethread.userid = 1
AND thread.visible = 1
AND lastpost > 1277054898
AND deletionlog.primaryid IS NULL
mysql error: Unknown column 'thread.threadid' in 'on clause'
mysql error number: 1054
我可以简单地取出 SELECT thread.threadid, thread.forumid 中的逗号吗?
请解释一下...
I'm getting the following error...
ERROR:
mysql error: Unknown column 'thread.threadid' in 'on clause'
I hear it has something to do with the MySQL version... what changes do I need to make to my PHP code to get passed this error? I read that This error arises because the comma operator was used in the SELECT query. This query was not designed to work under the new MySQL 5 strict query parser, which treats commas as lower precedence than joins.
Database error in vBulletin 3.0.7:
Invalid SQL:
SELECT thread.threadid, thread.forumid
FROM thread AS thread, subscribethread AS subscribethread
LEFT JOIN deletionlog AS deletionlog ON(deletionlog.primaryid = thread.threadid AND type = 'thread')
WHERE subscribethread.threadid = thread.threadid
AND subscribethread.userid = 1
AND thread.visible = 1
AND lastpost > 1277054898
AND deletionlog.primaryid IS NULL
mysql error: Unknown column 'thread.threadid' in 'on clause'
mysql error number: 1054
Can I simply take out the comma in the SELECT thread.threadid, thread.forumid?
Please explain...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您想要将
thread
与deletionlog
连接,但查询尝试将subscribethread
与deletionlog
连接。将其替换为:You want to join
thread
withdeletionlog
but the query is trying to joinsubscribethread
withdeletionlog
. Replace it with: