运行插入语句时出现 mysql 错误。错误是:
#1136 - Column count doesn't match value count at row 1. The insert has 5 values, BUT the comment id is set to AUTO INC
插入语句如下所示:
insert INTO comments (post_id, comment_name, comment_email, comment_text, status) VALUES ('78', 'm man', 'mon@mon.com', 'testh' 'unapprove')
表格是这样的
1) comment_id int(10) AUTO_INCREMENT 2) post_id int(10) 3) comment_name varchar(100) 4) comment_email varchar(100) 5) comment_text (text) 6) status (text)
有人可以帮忙吗?非常感谢你的努力
最佳答案
你犯了一个错误。您忘记在所有值之间设置逗号。更改您的查询:
insert INTO comments (post_id, comment_name, comment_email, comment_text, status) VALUES ('78', 'm man', 'mon@mon.com', 'testh' 'unapprove')
到
insert INTO comments (post_id, comment_name, comment_email, comment_text, status) VALUES ('78', 'm man', 'mon@mon.com', 'testh', 'unapprove')
关于php - MYsql插入语句错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25590800/