今天创建表的时候突然发现当我创建数据库的时候用如下sql语句:
create table SELLHOME
(
ID INT not null auto_increment,
ADMINID INT,
AREAID INT,
ESTATEID INT,
TITLE VARCHAR(50),
SELLPRICE FLOAT,
HOMETSIZE FLOAT,
ROOMNUM INT,
PARLORNUM INT,
WASHROOMNUM INT,
KITCHENNUM INT,
PROCHNUM INT,
FLOORNUM INT,
ALLFLOORNUM INT,
DECORATE INT,
FACE INT,
HOMEAGE INT,
MANAGEPAYE FLOAT,
LEASE BOOLEAN,
ISSUESTIME TIMESTAMP default CURRENT_TIMESTAMP,
UPDATETIME TIMESTAMP default CURRENT_TIMESTAMP,
INTRO VARCHAR(2000),
OWNERNAME VARCHAR(10),
OWNERPHONE VARCHAR(12),
primary key (ID)
);
系统报错,百思不得其解,最后网站google了一下,原来
ISSUESTIME TIMESTAMP default CURRENT_TIMESTAMP,
UPDATETIME TIMESTAMP default CURRENT_TIMESTAMP,
这两个字段不能同时是 default CURRENT_TIMESTAMP的 必须要改成这样:
ISSUESTIME TIMESTAMP default CURRENT_TIMESTAMP,
UPDATETIME TIMESTAMP default '0000-00-00 00:00:00',
这样才能通过