我正在尝试使用下面的代码在数据库中创建一个表。但是,它不起作用,我不知道为什么。
生成的错误是语法错误'UNIQUE KEY ID (ID)'
,但根据我正在使用的教程(以及我可以找到的文档),这看起来不错。
我也试过'UNIQUE ID (ID)'
and 'UNIQUE ID'
,但我仍然得到语法错误。
CREATE TABLE wp_offices (
ID smallint(3) NOT NULL AUTO_INCREMENT,
office_created_by smallint(3) DEFAULT "0",
office_created_date datetime DEFAULT "0000-00-00 00:00:00" NOT NULL,
office_last_edited_by smallint(3) DEFAULT "0",
office_last_edited_date datetime DEFAULT "0000-00-00 00:00:00" NOT NULL,
office_name tinytext COLLATE latin1_general_ci,
address_1 tinytext COLLATE latin1_general_ci,
address_2 tinytext COLLATE latin1_general_ci,
town tinytext COLLATE latin1_general_ci,
county tinytext COLLATE latin1_general_ci,
postcode tinytext COLLATE latin1_general_ci,
telephone tinytext COLLATE latin1_general_ci,
fax tinytext COLLATE latin1_general_ci,
dx tinytext COLLATE latin1_general_ci,
email tinytext COLLATE latin1_general_ci,
google_maps text(256) COLLATE latin1_general_ci
)
UNIQUE KEY ID (ID);
谁能告诉我我做错了什么?谢谢。