mysql q

Out of context: Reply #5

  • Started
  • Last post
  • 5 Responses
  • acescence0

    first timestamp (modified) is NOTNULL and ON UPDATE CURRENT_TIMESTAMP

    this gets set with current timestamp when the row is inserted or updated

    second timestamp (created) is NOTNULL and default 0000-00-00 00:00:00

    when you do an insert, if you pass a value of NULL for the created column, it will override the default and insert the current timestamp, seems a bit counter-intuitive, but it works, no query trickery required.

View thread