自己学下mysql还是迷糊
reate table Focus
(
pid int(11) auto_increment not null primary key,
ppics varchar(50),
ptexts varchar(50),
plinks varchar(50),
pdates datetime default (now()),
isshow varchar(2) not null
);
为啥出错啊

解决方案 »

  1.   


    改为:pdates timestamp default current_timestamp(),
      

  2.   


    楼上正解。 NOW()是微软系列的当前时间,在其它数据库产品中往往不是。甚至包括微软自己的SQL SERVER.建议参考一下mySQL的参考手册中函数,日期时间函数部分。
    http://dev.mysql.com/doc/refman/5.1/zh/functions.html#date-and-time-functions
      

  3.   

    now()是SQLSERVER的函数,MYSQL要用timestamp
      

  4.   


    MySQL中是有 now()函数的mysql> select now();
    +---------------------+
    | now()               |
    +---------------------+
    | 2009-03-13 12:49:11 |
    +---------------------+
    1 row in set (0.00 sec)