[英]MySql statement Error: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1
` Help beginner level here is the error “ 这里 帮助初学者级别 是错误
MySql statement Error: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1 SQL: insert into form values('danish','122016','danish.baksh@hyperquality.com','devloper','marketing','danish baksh','danish.baksh@hyperquality.com','156','fdjfj','564','fjf','867','dfj','5344','contactus.png','0') MySql语句错误:SQLSTATE [21S01]:插入值列表与列列表不匹配:1136列计数与第1行的值计数不匹配SQL:插入表单值('danish','122016','danish.baksh @ hyperquality.com','devloper','marketing','danish baksh','danish.baksh @ hyperquality.com','156','fdjfj','564','fjf','867','dfj ”, '5344', 'contactus.png', '0')
query 询问
$qry="insert into form values('$empname','$empcode','$empemail','$designation','$process','$supervisior','$supemail','$expense1','$aboutexp1','$expense2','$aboutexp2','$expense3','$aboutexp3','$total','$file_name','0')";
here is the database 这是数据库
CREATE TABLE `form` (
`empname` varchar(50) DEFAULT NULL,
`empcode` varchar(50) DEFAULT NULL,
`empemail` varchar(50) DEFAULT NULL,
`designation` varchar(50) DEFAULT NULL,
`process` varchar(50) DEFAULT NULL,
`supervisior` varchar(50) DEFAULT NULL,
`supemail` varchar(50) DEFAULT NULL,
`expense1` int(50) DEFAULT NULL,
`aboutexp1` varchar(50) DEFAULT NULL,
`expense2` int(50) DEFAULT NULL,
`aboutexp2` varchar(50) DEFAULT NULL,
`expense3` int(50) DEFAULT NULL,
`aboutexp3` varchar(50) DEFAULT NULL,
`total` int(50) DEFAULT NULL,
`bill` varchar(50) DEFAULT NULL,
`approved` tinyint(1) DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ask if u need more 问你是否需要更多
Try using below query: 尝试使用以下查询:
$qry="insert into form (empname,empcode,empemail,designation,process, supervisior,supemail,expense1,aboutexp1,expense2,aboutexp2,expense3, aboutexp3,total,bill,approved)
values('$empname','$empcode','$empemail','$designation','$process','$supervisior','$supemail','$expense1','$aboutexp1','$expense2','$aboutexp2','$expense3','$aboutexp3','$total','$file_name','0')";
It may help. 它可能有所帮助。 Moreover, You should have primary key in your table.
此外,您的表中应该有主键。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.