MySQl查询问题
我并没有花太多时间在 MySQL 上,但我被要求调查我的教会网站的问题。它已经停机很长一段时间了,我正在努力让它恢复正常运行。最初的网站是在Mambo 4.5.3中完成的,这是一个旧版本。我会在某个时候升级它,但我只想让它暂时运行。
我目前在使用下面的 Mambo 内置查询时遇到问题。无论站点管理尝试访问页面,我都会收到错误消息:
“on 子句”中存在未知列“c.access”。
我已经验证该列确实存在于指定的表中。现在我很困惑。我打开 MySQL 查询分析器并粘贴查询,我得到了相同的错误消息,代码为 1054。有人有什么想法吗?
SELECT
c.*,
g.name AS groupname,
cc.name,
u.name AS editor,
f.content_id AS frontpage,
s.title AS section_name,
v.name AS author
FROM
mos_content AS c,
mos_categories AS cc,
mos_sections AS s
LEFT JOIN mos_groups AS g ON g.id = c.access
LEFT JOIN mos_users AS u ON u.id = c.checked_out
LEFT JOIN mos_users AS v ON v.id = c.created_by
LEFT JOIN mos_content_frontpage AS f ON f.content_id = c.id
WHERE
c.state >= 0
AND c.catid=cc.id
AND cc.section=s.id
AND s.scope='content'
ORDER BY
s.title,
c.catid,
cc.ordering,
cc.title,
c.ordering
LIMIT
0,10
I don't spend a whole lot of time in MySQL, but I have been asked to look into a problem with my church's website. It has been down for quite some time and I am trying to get it back up and running. The original site was done in Mambo 4.5.3, which is an old version. I will upgrade it at some point, but I just want to get it running for the time being.
I am currently having a problem with the Mambo built in query below. Wherever the site administration tries to access pages, I get the error message:
Unknown column 'c.access' in 'on clause'.
I have verified that the column does exist in the specified table. Now I am stumped. I opened up the MySQL Query analyzer and pasted the query in and I get the same error message with code 1054. Does anyone have any ideas?
SELECT
c.*,
g.name AS groupname,
cc.name,
u.name AS editor,
f.content_id AS frontpage,
s.title AS section_name,
v.name AS author
FROM
mos_content AS c,
mos_categories AS cc,
mos_sections AS s
LEFT JOIN mos_groups AS g ON g.id = c.access
LEFT JOIN mos_users AS u ON u.id = c.checked_out
LEFT JOIN mos_users AS v ON v.id = c.created_by
LEFT JOIN mos_content_frontpage AS f ON f.content_id = c.id
WHERE
c.state >= 0
AND c.catid=cc.id
AND cc.section=s.id
AND s.scope='content'
ORDER BY
s.title,
c.catid,
cc.ordering,
cc.title,
c.ordering
LIMIT
0,10
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
错误 1052 消息文本是实际上,
%s 中的“foo”列是不明确的
。当您连接具有相同名称的列的表并且在不使用表前缀的情况下引用它们时,通常会发生这种情况。:-?
The error 1052 message text is actually something like
Column 'foo' in %s is ambiguous
. It normally happens when you join tables that have columns with the same name and you refer to them without the table prefix.:-?