0

这就是我投入的!

ALTER TABLE usersADD totalInfractionsINT(1) NOT NULL DEFAULT '0', ADD totalWarningsINT(1) NOT NULL DEFAULT '0', ADD bannedINT(1) NOT NULL DEFAULT '0'; INSERT INTO menu(id, text, url, resource, usergroup, protected, weight) VALUES (NULL, 'Add infraction', 'infraction.add', '_res/infraction/add.php', '5', '0', '0'); INSERT INTO menu(id, text, url, resource, usergroup, protected, weight) VALUES (NULL, 'Remove infraction', 'infraction.remove', '_res/infraction/remove.php', '5', '0', '0'); INSERT INTO menu(id, text, url, resource, usergroup, protected, weight) VALUES (NULL, 'View infraction log', 'infraction.viewLog', '_res/infraction/view.php', '5', ' 0', '0'); 插入menu(id, text, url, resource, usergroup, protected, weight) VALUES (NULL, 'Clear infraction log', 'infraction.clearLog', '_res/infraction/clear_log.php', '5', '0', ' 0'); INSERT INTO menu(id, text, url, resource, usergroup, protected, weight) VALUES (NULL, '查看我的违规日志', 'user.viewMyLog', '_res/infraction/view_mine.php', '1', '0 ', '0'); CREATE TABLE infraction_log( idINT( 255 ) NOT NULL AUTO_INCREMENT PRIMARY KEY, usernameVARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL, reasonVARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL, typeVARCHAR( 100 ) CHARACTER SET latin1,NULL COLLATE latin1_general_ci NOTaddremissuedbyVARCHAR(100) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL, timestampTIMESTAMP(255) ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP) ENGINE = MYISAM;


这是错误

ALTER TABLE usersADD totalInfractionsINT(1) NOT NULL DEFAULT '0', ADD totalWarningsINT(1) NOT NULL DEFAULT '0', ADD bannedINT(1) NOT NULL DEFAULT '0';

MySQL 说:

1060 - 重复的列名“totalInfractions”

4

1 回答 1

1

错误信息很清楚:

重复的列名“totalInfractions”

您正在尝试使用另一列已有的名称向表中添加一列。

于 2012-07-29T05:39:53.320 回答