自动时间戳新条目到数据库 (phpMyAdmin)
If I want each new entry into my db to be automatically timestamped, would I set the Field Type to "timestamp" and have the Default value set to "CURRENT_TIMESTAMP"?
Is this the correct method?
解决方案That is correct. In SQL code that would be:
CREATE TABLE `table` (
...
`date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
...
)
相关文章