错误:“字段列表”中的未知列'StudyQuestionResponse'

时间:2015-10-09 00:29:38

标签: php mysql

我相信这个变量在我的数据库拼写正确,所以我不确定是什么问题。有人能帮助我吗?

这是codeData表的MySQL模式:

CREATE TABLE IF NOT EXISTS `interviewcodes`.`codedata` (
  `StudyID` INT(11) NOT NULL,
  `ParticipantID` INT(11) NOT NULL,
  `CoderID` INT(11) NOT NULL,
  `CodingMonth` INT(11) NOT NULL,
  `CodingDay` INT(11) NOT NULL,
  `CodingYear` INT(11) NOT NULL,
  `StudyQuestionLabel` VARCHAR(45) NOT NULL,
  `StudyQuestionResponse` VARCHAR(245) NULL,
  `IWAcode` INT(11) NULL DEFAULT 0,
  `CQcode` INT(11) NULL DEFAULT 0,
  `CRcode` INT(11) NULL DEFAULT 0,
  `PMinusCode` INT(11) NULL DEFAULT 0,
  `PPlusCode` INT(11) NULL DEFAULT 0,
  `PROcode` INT(11) NULL DEFAULT 0,
  `CONcode` INT(11) NULL DEFAULT 0,
  `RELcode` INT(11) NULL DEFAULT 0,
  `NOAcode` INT(11) NULL DEFAULT 0,
  `OTHcode` INT(11) NULL DEFAULT 0,
  `TotalScore` INT(11) NULL DEFAULT 0,
  `Remark` VARCHAR(5000) NULL DEFAULT NULL,
  `studyquestion_StudyID` INT(11) NOT NULL,
  `studyquestion_StudyQuestionLabel` VARCHAR(45) NOT NULL,
  PRIMARY KEY (`StudyID`, `ParticipantID`, `StudyQuestionLabel`, `studyquestion_StudyID`, `studyquestion_StudyQuestionLabel`),
  INDEX `fk_CodeData_Participant1_idx` (`ParticipantID` ASC),
  INDEX `fk_CodeData_StudyCoders1_idx` (`CoderID` ASC),
  INDEX `fk_codedata_studyquestion1_idx` (`studyquestion_StudyID` ASC, `studyquestion_StudyQuestionLabel` ASC),
  CONSTRAINT `fk_CodeData_Participant1`
    FOREIGN KEY (`ParticipantID`)
    REFERENCES `interviewcodes`.`participant` (`ParticipantID`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_CodeData_StudyCoders1`
    FOREIGN KEY (`CoderID`)
    REFERENCES `interviewcodes`.`studycoders` (`CoderID`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_codedata_studyquestion1`
    FOREIGN KEY (`studyquestion_StudyID` , `studyquestion_StudyQuestionLabel`)
    REFERENCES `interviewcodes`.`studyquestion` (`StudyID` , `StudyQuestionLabel`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_codedata_studylkup1`
    FOREIGN KEY (`StudyID`)
    REFERENCES `interviewcodes`.`studylkup` (`StudyID`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;

这就是我想用PHP插入的内容:

$sql1 = "INSERT INTO CodeData (StudyID, ParticipantID, CoderID,
        CodingMonth, CodingDay, CodingYear, StudyQuestionLabel, 
        StudyQuestionResponse, IWAcode, CQcode, CRcode, PMinusCode,
        PPlusCode, PROcode, CONcode, RELcode, NOAcode, OTHcode, TotalScore, 
        Remark) VALUES
    ('".$StudyID."',".
        "'".$ParticipantID."',".
        "'".$CoderID."',".
        "'".$CodingMonth."',".
        "'".$CodingDay."',".
        "'".$CodingYear."',".
        "'".$StudyQuestionLabel."',".
        "'".$StudyQuestionResponse."',".
        "'".$IWAcode."',".
        "'".$CQcode."',".
        "'".$CRcode."',".
        "'".$PMinusCode."',".
        "'".$PPlusCode."',".
        "'".$PROcode."',".
        "'".$CONcode."',".
        "'".$RELcode."',".
        "'".$NOAcode."',".
        "'".$OTHcode."',".
        "'".$TotalScore."',".
        "'".$Remark."')";

这是我收到的错误消息:

Error: Unknown column 'StudyQuestionResponse' in 'field list'

0 个答案:

没有答案