Inserting NOW() value in datetime datatype is returning 0000-00-00 00:00:00

后端 未结 3 1168
攒了一身酷
攒了一身酷 2021-01-26 10:13

I had a database that had a perfectly working NOW() function, displaying the right date. And after accidentally deleted it, I created a similar database, but when I inserted NOW

3条回答
  •  离开以前
    2021-01-26 10:47

    You have quotes around the NOW() function. Change it to:

    INSERT INTO `blog_details` (`title`, `blog_content`, `blog_date`, `cat_name`)
    VALUES('Breaking Bad TV Series', 'Best series evar', NOW(), 'Uncategorized');
    

提交回复
热议问题