Store php datetime in mysql database

前端 未结 6 477
迷失自我
迷失自我 2020-12-09 03:38

I can\'t believe I can\'t do this, but I want to be able to store the current date and time from php in to a mysql table.

The column in the table is type datetime. I

6条回答
  •  -上瘾入骨i
    2020-12-09 03:59

    Create column type TIMESTAMP and set it to NOT NULL. Then pass in NULL during INSERT and MySQL will insert current date and time. This works for me.

提交回复
热议问题