gpt4 book ai didi

php - 'on clause' :( 中的 MySQL 未知列

转载 作者:行者123 更新时间:2023-11-30 23:13:42 25 4
gpt4 key购买 nike

我的查询看起来像

SELECT а.*, m.username, m.picture, m.picture_active
FROM questions_answer AS а
INNER JOIN members AS m ON а.poster_id=m.member_id
INNER JOIN questions AS q ON q.question_id=a.question_id
ORDER BY a.postdate DESC

我遇到错误:

Unknown column 'a.question_id' in 'on clause'

我不知道哪里出了问题,请帮我解决这个问题。

问题

CREATE TABLE IF NOT EXISTS `questions` (
`question_id` int(9) unsigned NOT NULL AUTO_INCREMENT,
`member_id` int(9) unsigned NOT NULL DEFAULT '0',
`question` text NOT NULL,
`postdate` int(10) unsigned NOT NULL DEFAULT '0',
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`question_id`),
KEY `member_id` (`member_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

questions_answer

CREATE TABLE IF NOT EXISTS `questions_answer` (
`answer_id` bigint(12) unsigned NOT NULL AUTO_INCREMENT,
`question_id` int(9) unsigned NOT NULL,
`poster_id` int(9) unsigned NOT NULL,
`body` text NOT NULL,
`postdate` int(9) unsigned NOT NULL,
PRIMARY KEY (`answer_id`),
KEY `question_id` (`question_id`),
KEY `poster_id` (`poster_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

最佳答案

您的表 questions_answer 可能没有列 question_id

关于php - 'on clause' :( 中的 MySQL 未知列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18814468/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com