#1064 - 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 10 行的“CONSTRAINT FOREIGN KEY ( entry_id
) REFERENCES entry
( entry_id
) ON DELETE CAS”附近使用正确的语法
CREATE TABLE IF NOT EXISTS `comment` (
`comment_id` int(11) NOT NULL AUTO_INCREMENT,
`entry_id` int(11) NOT NULL,
`comment_name` varchar(100) NOT NULL,
`comment_email` varchar(100) NOT NULL,
`comment_body` text NOT NULL,
`comment_state` tinyint(1) NOT NULL DEFAULT '0',
`comment_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`comment_id`)
CONSTRAINT FOREIGN KEY (`entry_id`) REFERENCES `entry`(`entry_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=34 ;