Issue
I have a table where I have a date
column. Is there a way for MySQL to auto fill this field whenever I insert a new registry with the current date? Or is this made automatically by default?
P.S.: I'm using PHPMyAdmin
Solution
MySQL unfortunately doesn't allow specifying values other than constants as the default for columns other than TIMESTAMP
s.
This is a feature available in MySQL versions 8.0+, but for older versions the only solution for a database defined default would be to use a trigger.
Answered By - Ben Siver
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.