查询:
SELECT c.title AS title
, c.introtext AS body
, c.state AS state
, c.created AS created
, c.created_by AS uid
, c.modified AS modified
, c.modified_by AS modified_uid
, c.published AS published
, c.published_by AS published_uid
, jos_categories.title AS category
FROM
jos_content AS c, jos_categories
INNER JOIN jos_categories AS jc
ON c.sectionid = jc.section
WHERE c.sectionid = 7
我确定sectionid列存在,但我收到错误:
错误代码:1054。'on'中的未知列'c.sectionid' 条款'0.000秒
我看到了这个主题:MySQL unknown column in ON clause但我也解决不了。
答案 0 :(得分:1)
将您的FROM子句更改为:
FROM jos_content AS c
INNER JOIN jos_categories AS jc
ON c.sectionid = jc.section
WHERE c.sectionid = 7
答案 1 :(得分:0)
您在jos_categories
和jos_categories AS jc
之间执行联接:
jos_content AS c, jos_categories
INNER JOIN jos_categories AS jc
ON c.sectionid = jc.section
但c
是jos_content
...