1

我收到以下错误...

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中的逗号吗?

请解释...

4

1 回答 1

0

您想加入threaddeletionlog但查询正在尝试subscribethread加入deletionlog。将其替换为:

FROM subscribethread AS subscribethread, thread AS thread
LEFT JOIN deletionlog AS deletionlog ON(deletionlog.primaryid = thread.threadid AND type = 'thread')
于 2010-06-21T06:07:13.420 回答