Issue
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?
Solution
That is correct. In SQL code that would be:
CREATE TABLE `table` (
...
`date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
...
)
Answered By - BoltClock
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.