Mysql now() function as default value

QuestionsMysql now() function as default value
Azam asked 9 years ago

Can I set now() function as a default value for a field while adding a new entry?

2 Answers
Abu Ghufran answered 9 years ago

There are 2 solutions.
1. Use on_insert event handler and write your own insert query that have now().
2. Use current_timestamp default value: http://stackoverflow.com/a/168832/385377

Azam answered 9 years ago

Thank you! It works.

Your Answer

16 + 5 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?