dongyi7513 2013-11-12 18:18 采纳率: 100%
浏览 34
已采纳

MySQL表1提交了DATETIME格式

I have this table (events) just 1 filed (date):

date
2013-11-03 15:11:05
2013-11-04 15:11:05
2013-11-05 15:11:05

Now I'm trying this query exactly like this;

$insert = mysql_query("INSERT INTO events VALUES (2013-06-27 12:00:00)");

any reason why is not updating the table?

  • 写回答

1条回答 默认 最新

  • dongsui4658 2013-11-12 18:19
    关注

    You need quotes around the date and missed the values keyword

    INSERT INTO events values ('2013-06-27 12:00:00')
    

    SQLFiddle demo

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?