我遇到此错误
错误代码:1136 列数与第1行的值数不匹配 插入fgm_pastor( matriculePastor, pastorName, 牧师姓氏 pastorBirthdayDate, BirthdayPlace, 牧师父名, 牧师的母亲 pastorSexe, pastor电话, 牧师电子邮件, dateConversion, workBeforeBibleSchool, rankProbation, areaOfCalling, nberYearArea, nbreYearDistrict, 军事情况 国籍, 牧师地址 photoProfil, raisonIndispoMissionnaire, ID) 价值 ( 'matriculetest3', “ nom test”, 'prenomtest', '2013-09-12', 'Dagobert', “ mon pere resr”, “仅仅是考验”, 'M', “电话测试”, “ pastorEmail测试”, '2018-12-28', “ infomaticien”, “等级测试”, “区域测试”, 1, 3, “单项测试”, “ Cameroun测试”, “地址测试”, “ phototest”, 'RAS', 4 );
我已经指出了值列,但没有任何作用
这是我的查询,请帮助我
INSERT INTO fgm_pastor(
matriculePastor,
pastorName,
pastorSurname,
pastorBirthdayDate,
birthdayPlace,
pastorFathername,
pastorMothername,
pastorSexe,
pastorPhone,
pastorEmail,
dateConversion,
workBeforeBibleSchool,
rankProbation,
areaOfCalling,
nberYearArea,
nbreYearDistrict,
martialSituation,
nationality,
pastorAdresse,
photoProfil,
raisonIndispoMissionnaire,
id)
VALUES
(
'matriculetest3',
'nom test',
'prenomtest',
'2013-09-12',
'Dagobert',
'mon pere resr',
'ma mere test',
'M',
'phone test',
'pastorEmail test',
'2018-12-28',
'infomaticien',
'rank test',
'area test',
1,
3,
'Single test',
'Cameroun test',
'adresse test',
'phototest',
'RAS',
4
);
这是我的表结构
CREATE TABLE `fgm_pastor` (
`matriculePastor` VARCHAR (180),
`pastorName` VARCHAR (180),
`pastorSurname` VARCHAR (180),
`pastorBirthdayDate` DATE ,
`birthdayPlace` VARCHAR (180),
`pastorFatherName` VARCHAR (180),
`pastorMotherName` VARCHAR (180),
`pastorSexe` CHAR (3),
`pastorPhone` VARCHAR (180),
`pastorEmail` VARCHAR (180),
`dateConversion` DATE ,
`workBeforeBibleSchool` VARCHAR (180),
`rankProbation` VARCHAR (180),
`areaOfCalling` VARCHAR (300),
`nberYearArea` INT (11),
`nbreYearDistrict` INT (11),
`martialSituation` VARCHAR (180),
`nationality` VARCHAR (180),
`pastorAdresse` VARCHAR (300),
`photoProfil` TEXT ,
`isActif` TINYINT (1),
`raisonIndispoMissionnaire` TEXT ,
`isDelete` INT (1),
`id` INT (11)
);
答案 0 :(得分:0)
对名称和工作列使用反引号。您的某些列名是MySQL保留字,最好不要将它们用作列名:
INSERT INTO fgm_pastor
( matricule, `name`, surname, birthdayDate, birthdayPlace, fatherName,
motherName, gender, phone, email, dateC, `work`, rankProbation,
areaOfCalling, nberArea,nbreDistrict, martialSituation, nationality,
adresse, picture, raisonIndis, id)
VALUES ( 'matricust3', 'nom test', 'prenomtest', '2013-09-12', 'Dagobert', 'monperesr',
'mamere', 'M', 'phone test', 'pastorEmail test', '2018-12-28', 'infomaticien', 'rank test',
'area test', 1, 3, 'Single test', 'Cameroun test',
'adresse test', 'phototest', 'RAS', 4)