Insert current date/time using now() in a field using MySQL/PHP

后端 未结 9 1376
不知归路
不知归路 2021-02-01 01:00

Since MySQL evidently cannot automatically insert the function now() in a datetime field in adding new records like some other databases, based on comments, I\'m explicitly tryi

9条回答
  •  天命终不由人
    2021-02-01 01:39

    Currently, and with the new versions of Mysql can insert the current date automatically without adding a code in your PHP file. You can achieve that from Mysql while setting up your database as follows:

    Now, any new post will automatically get a unique date and time. Hope this can help.

提交回复
热议问题