mysql 错误:未知列“thread.threadid”在“on 子句”中

发布于 2024-09-06 08:46:26 字数 887 浏览 4 评论 0原文

我收到以下错误...

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

想挽留 2024-09-13 08:46:26

您想要将 threaddeletionlog 连接,但查询尝试将 subscribethreaddeletionlog 连接。将其替换为:

FROM subscribethread AS subscribethread, thread AS thread
LEFT JOIN deletionlog AS deletionlog ON(deletionlog.primaryid = thread.threadid AND type = 'thread')

You want to join thread with deletionlog but the query is trying to join subscribethread with deletionlog. Replace it with:

FROM subscribethread AS subscribethread, thread AS thread
LEFT JOIN deletionlog AS deletionlog ON(deletionlog.primaryid = thread.threadid AND type = 'thread')
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文