错误SQL 查询: INSERTINTO`admin` (`AdminID` ,`ad_user` ,`ad_pass` ,`ad_date`) 
VALUES ( NULL ,'123','123','CURRENT_TIMESTAMP'
)
 
MySQL 返回: 
#1292 - Incorrect datetime value: 'CURRENT_TIMESTAMP' for column 'ad_date' at row 1
 这个是在网上服务器的, 有个问题 ad_date 是添加当前时间 但报错了 我在本地是可以的,在另外一个网上服务器也是可以的表CREATE TABLE Admin(AdminID int NOT NULL AUTO_INCREMENT, PRIMARY KEY(AdminID),ad_user tinytext,ad_pass text,
ad_date timestamp default current_timestamp)请问是什么问题啊

解决方案 »

  1.   

    把引号去了。INSERTINTO`admin` (`AdminID` ,`ad_user` ,`ad_pass` ,`ad_date`)  
    VALUES (  NULL ,'123','123',CURRENT_TIMESTAMP
    )
      
      

  2.   

    不是上面的是  直接操作插入 我自己没写语句  但按你上面的操作也报错了错误SQL 查询:INSERTINTO `admin` ( `AdminID` ,`ad_user` ,`ad_pass` ,`ad_date` 
    ) VALUES (
     NULL ,'123','123', 
    CURRENT_TIMESTAMP 
    )
     
    MySQL 返回: 
    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERTINTO`admin` (`AdminID` ,`ad_user` ,`ad_pass` ,`ad_date`)   
    VALUES (
     
    ' at line 1 
      

  3.   

    INSERT INTO  你的连在一起了。