I have some problem while use mysql. and I completely don't know!.
That problem is...
$sql = "insert into Write_Member_Comment(writer, passwd, commentID)
values('test', '$passwd' '$commentID')";
mysql_query($sql, $connect);
echo mysql_error();
I fill in writer 'test' in temporarily(orginally this is '$writer'), however result is...
'Column count doesn't match value count at row 1'
Here's my Write_Member_Comment table.
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;
Why does not working?
You're missing a comma, it should be:
$sql = "insert into Write_Member_Comment(writer, passwd, commentID)
values('test', '$passwd', '$commentID')";