Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Autodate

forums forums SQLyog Using SQLyog Autodate

  • This topic is empty.
Viewing 1 reply thread
  • Author
    Posts
    • #8644
      energylevel
      Member

      Is it possible to auto insert curent date in a MySQL database when a record is created ??

    • #16512
      Shadow
      Member

      If you mean to have a column that is set to the current date when a record is inserted, then yes, this's what timestamp fields are for. If you mean to “log” the insertion date in any other table, then strictly speaking no, as MySql has no support for triggers as of now. Of course, you may still use transactions. You start a transaction, insert a record to a table, insert a current date to a second one, then commit. This method will never be that accurate like a trigger, but close enough.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.