使用mysql时遇到了一些问题。我完全不知道!。
那个问题是......
$sql = "insert into Write_Member_Comment(writer, passwd, commentID)
values('test', '$passwd' '$commentID')";
mysql_query($sql, $connect);
echo mysql_error();
我暂时填写作家'测试'(或者这是'$ writer'),但结果是......
'Column count doesn't match value count at row 1'
这是我的Write_Member_Comment表。
create table Write_Member_Comment(
writer char(30) not null,
passwd char(30) not null,
commentID int not null,
FOREIGN KEY (commentID) REFERENCES PostComment(commentID) ON DELETE CASCADE ON UPDATE CASCADE) engine=InnoDB character set=utf8;
为什么不工作?
答案 0 :(得分:3)
你错过了一个逗号,它应该是:
$sql = "insert into Write_Member_Comment(writer, passwd, commentID)
values('test', '$passwd', '$commentID')";