MySQL auto-store datetime for each row
If you're using phpmyadmin you can do this by :
You can use DEFAULT constraints to set the timestamp:
ALTER TABLE
MODIFY dt_created datetime DEFAULT CURRENT_TIMESTAMP
ALTER TABLE
MODIFY dt_modified datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
Then you wouldn't have to specify NOW()
in your INSERT/UPDATE statements.
Reference: TIMESTAMP properties