我在代码点火器中有一个查询,它不起作用.
错误:'on子句‘中未知列'forum_topics.category’
SELECT * FROM (`forum_topics`)
JOIN `forum_categories` ON `forum_topics`.`category` = `forum_categories`.`id`
WHERE `forum_categories`.`forum` = 1 LIMIT 10DDL:
CREATE TABLE IF NOT EXISTS forum_topics (
id int(11) NOT NULL AUTO_INCREMENT,
title varchar(255) NOT NULL,
user int(11) NOT NULL,
date bigint(20) NOT NULL,
text longtext NOT NULL,
` category` int(11) NOT NULL,
status int(11) NOT NULL DEFAULT '0', PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;查询:
$select = $this->db->select('*')->from('forum_topics')->join('forum_categories',
'forum_topics.category = forum_categories.id')->where('forum_categories.forum',
$forum_id)->limit(10, $pag_start)->get();我搜索了所有的互联网,但没有找到解决办法。
谢谢
发布于 2014-08-09 13:42:27
您已经创建了一个名为
` category`这应该是
`category`或引用为
`forum_topics`.` category`https://stackoverflow.com/questions/25219124
复制相似问题